From da68c792558e740c02c37c6c7fae124074fe7dd7 Mon Sep 17 00:00:00 2001 From: Sridhar Gaddam Date: Fri, 10 Apr 2026 18:39:09 +0530 Subject: [PATCH] fix: make pod readiness check more reliable after restart The e2e test was re-listing pods immediately after deletion and waiting on specific pod names, which made it prone to race conditions. It could end up waiting on terminating pods which will never reach ready state. This PR modifies the code to use Eventually to fix the issue. Signed-off-by: Sridhar Gaddam --- tests/e2e/controlplane/control_plane_update_test.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tests/e2e/controlplane/control_plane_update_test.go b/tests/e2e/controlplane/control_plane_update_test.go index 7d7683f21e..d0fca84c59 100644 --- a/tests/e2e/controlplane/control_plane_update_test.go +++ b/tests/e2e/controlplane/control_plane_update_test.go @@ -223,12 +223,7 @@ spec: cl.Delete(ctx, &pod) } - Expect(cl.List(ctx, samplePods, client.InNamespace(sampleNamespace))).To(Succeed()) - Expect(samplePods.Items).ToNot(BeEmpty(), "No pods found in sample namespace") - for _, pod := range samplePods.Items { - Eventually(common.GetObject).WithArguments(ctx, cl, kube.Key(pod.Name, sampleNamespace), &corev1.Pod{}). - Should(HaveConditionStatus(corev1.PodReady, metav1.ConditionTrue), "Pod is not Ready") - } + Eventually(common.CheckPodsReady).WithArguments(ctx, cl, sampleNamespace).Should(Succeed(), "Sample pods are not ready after restart") Success("sample pods restarted and are ready") })