From fd8bf1c82117ebf70c365d5d22cb5420a92d8dd3 Mon Sep 17 00:00:00 2001 From: Peter Hunt Date: Mon, 23 Jun 2025 13:42:21 -0400 Subject: [PATCH] e2e: retry getting status on restart policy tests as the containers in a pod restart, the pod may enter exponential backoff, which delays the pod being ready. In this case for this pod, it's expected, but we shouldn't fail to continue the test before the container has been given the chance to start again Signed-off-by: Peter Hunt --- test/e2e/common/node/runtime.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/e2e/common/node/runtime.go b/test/e2e/common/node/runtime.go index fedf1241c28..f72f66e47f2 100644 --- a/test/e2e/common/node/runtime.go +++ b/test/e2e/common/node/runtime.go @@ -117,9 +117,9 @@ while true; do sleep 1; done gomega.Eventually(ctx, terminateContainer.GetPhase, ContainerStatusRetryTimeout, ContainerStatusPollInterval).Should(gomega.Equal(testCase.Phase)) ginkgo.By(fmt.Sprintf("Container '%s': should get the expected 'Ready' condition", testContainer.Name)) - isReady, err := terminateContainer.IsReady(ctx) - gomega.Expect(isReady).To(gomega.Equal(testCase.Ready)) - framework.ExpectNoError(err) + gomega.Eventually(ctx, func() (bool, error) { + return terminateContainer.IsReady(ctx) + }, ContainerStatusRetryTimeout, ContainerStatusPollInterval).Should(gomega.Equal(testCase.Ready)) status, err := terminateContainer.GetStatus(ctx) framework.ExpectNoError(err)