mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +00:00
Fix bugs in e2e pod test
- Update test to account for late synced statuses - Terminated containers are not running - Add missing format values to test logline
This commit is contained in:
parent
3005ef34f2
commit
f9a827b895
@ -379,12 +379,14 @@ var _ = SIGDescribe("Pods Extended", func() {
|
||||
switch {
|
||||
case t.ExitCode == 1:
|
||||
// expected
|
||||
case t.ExitCode == 137 && (t.Reason == "ContainerStatusUnknown" || t.Reason == "Error"):
|
||||
// expected, pod was force-killed after grace period
|
||||
case t.ExitCode == 128 && (t.Reason == "StartError" || t.Reason == "ContainerCannotRun") && reBug88766.MatchString(t.Message):
|
||||
// pod volume teardown races with container start in CRI, which reports a failure
|
||||
framework.Logf("pod %s on node %s failed with the symptoms of https://github.com/kubernetes/kubernetes/issues/88766", pod.Name, pod.Spec.NodeName)
|
||||
default:
|
||||
data, _ := json.MarshalIndent(pod.Status, "", " ")
|
||||
framework.Logf("pod %s on node %s had incorrect final status:\n%s", string(data))
|
||||
framework.Logf("pod %s on node %s had incorrect final status:\n%s", pod.Name, pod.Spec.NodeName, string(data))
|
||||
return fmt.Errorf("pod %s on node %s container unexpected exit code %d: start=%s end=%s reason=%s message=%s", pod.Name, pod.Spec.NodeName, t.ExitCode, t.StartedAt, t.FinishedAt, t.Reason, t.Message)
|
||||
}
|
||||
switch {
|
||||
@ -425,7 +427,7 @@ var _ = SIGDescribe("Pods Extended", func() {
|
||||
if !hasTerminalPhase {
|
||||
var names []string
|
||||
for _, status := range pod.Status.ContainerStatuses {
|
||||
if status.State.Terminated != nil || status.State.Running != nil {
|
||||
if status.State.Running != nil {
|
||||
names = append(names, status.Name)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user