From eb7f6ec574bca7923f76cbd55cd1d9bbb6d04585 Mon Sep 17 00:00:00 2001 From: xueqzhan Date: Mon, 4 May 2026 12:07:32 -0400 Subject: [PATCH] Try to deflake the deployment test by refreshing the rv used for watch --- test/e2e/apps/deployment.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/e2e/apps/deployment.go b/test/e2e/apps/deployment.go index 5289802cb45e9..e619e4fa62b25 100644 --- a/test/e2e/apps/deployment.go +++ b/test/e2e/apps/deployment.go @@ -255,6 +255,12 @@ var _ = SIGDescribe("Deployment", func() { }) framework.ExpectNoError(err, "failed to see replicas of %v in namespace %v scale to requested amount of %v", testDeployment.Name, testNamespaceName, testDeploymentDefaultReplicas) + // Refresh the deployment list to get a current resourceVersion. + // The RV from the initial List may be too old for the watch cache + // after waiting for pods to become ready (image pulls can take 60s+). + deploymentsList, err = f.ClientSet.AppsV1().Deployments("").List(ctx, metav1.ListOptions{LabelSelector: testDeploymentLabelsFlat}) + framework.ExpectNoError(err, "failed to list Deployments") + ginkgo.By("patching the Deployment") deploymentPatch, err := json.Marshal(map[string]interface{}{ "metadata": map[string]interface{}{