Merge pull request #123285 from pohly/e2e-pod-phase

e2e pod: dump pod in unexpected phase
This commit is contained in:
Kubernetes Prow Robot
2024-02-15 16:34:54 -08:00
committed by GitHub
2 changed files with 21 additions and 3 deletions

View File

@@ -75,7 +75,7 @@ func BeRunningNoRetries() types.GomegaMatcher {
gcustom.MakeMatcher(func(pod *v1.Pod) (bool, error) {
switch pod.Status.Phase {
case v1.PodFailed, v1.PodSucceeded:
return false, gomega.StopTrying(fmt.Sprintf("Expected pod to reach phase %q, got final phase %q instead.", v1.PodRunning, pod.Status.Phase))
return false, gomega.StopTrying(fmt.Sprintf("Expected pod to reach phase %q, got final phase %q instead:\n%s", v1.PodRunning, pod.Status.Phase, format.Object(pod, 1)))
default:
return true, nil
}

View File

@@ -366,7 +366,16 @@ In [It] at: wait_test.go:71 <time>
Status: "failed",
Failure: &reporters.JUnitFailure{
Description: `[FAILED] Told to stop trying after <after>.
Expected pod to reach phase "Running", got final phase "Failed" instead.
Expected pod to reach phase "Running", got final phase "Failed" instead:
<*v1.Pod>:
metadata:
creationTimestamp: null
name: failed-pod
namespace: default
spec:
containers: null
status:
phase: Failed
In [It] at: wait_test.go:75 <time>
`,
Type: "failed",
@@ -378,7 +387,16 @@ In [It] at: wait_test.go:75 <time>
k8s.io/kubernetes/test/e2e/framework/pod_test.glob..func1.6()
wait_test.go:75
[FAILED] Told to stop trying after <after>.
Expected pod to reach phase "Running", got final phase "Failed" instead.
Expected pod to reach phase "Running", got final phase "Failed" instead:
<*v1.Pod>:
metadata:
creationTimestamp: null
name: failed-pod
namespace: default
spec:
containers: null
status:
phase: Failed
In [It] at: wait_test.go:75 <time>
< Exit [It] failed - wait_test.go:74 <time>
`,