From 6f5240b19c6b294b64cef9deb90da93a8170f7e8 Mon Sep 17 00:00:00 2001 From: Ed Bartosh Date: Wed, 20 Mar 2024 10:41:02 +0200 Subject: [PATCH] e2e_node: fix podresources test Fixed `The phase of Pod e2e-test-pod is Succeeded which is unexpected` error. `e2epod.NewPodClient(f).CreateSync` is unable to catch 'Running' status of the pod as pod finishes too fast. Using `Create` API should solve the issue as it doesn't query pod status. --- test/e2e_node/podresources_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e_node/podresources_test.go b/test/e2e_node/podresources_test.go index 0abf62b7dd3..09c1a3ef207 100644 --- a/test/e2e_node/podresources_test.go +++ b/test/e2e_node/podresources_test.go @@ -1027,7 +1027,7 @@ var _ = SIGDescribe("POD Resources", framework.WithSerial(), feature.PodResource } pod := makePodResourcesTestPod(pd) pod.Spec.Containers[0].Command = []string{"sh", "-c", "/bin/true"} - pod = e2epod.NewPodClient(f).CreateSync(ctx, pod) + pod = e2epod.NewPodClient(f).Create(ctx, pod) defer e2epod.NewPodClient(f).DeleteSync(ctx, pod.Name, metav1.DeleteOptions{}, time.Minute) err := e2epod.WaitForPodCondition(ctx, f.ClientSet, pod.Namespace, pod.Name, "Pod Succeeded", time.Minute*2, testutils.PodSucceeded) framework.ExpectNoError(err)