From 2168dd5334da0bd2ad79551ae5daae3ef6eb89c8 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Tue, 25 Oct 2022 13:17:11 +0200 Subject: [PATCH] e2e apps: capture expected state before making changes Looking up the expected nodes in the goroutine raced with the test making changes to the configuration. When doing (unrelated?) changes, the test started to fail: Oct 23 15:47:03.092: INFO: Unexpected error: <*errors.errorString | 0xc001154c70>: { s: "no subset of available IP address found for the endpoint test-rolling-update-with-lb within timeout 2m0s", } Oct 23 15:47:03.092: FAIL: no subset of available IP address found for the endpoint test-rolling-update-with-lb within timeout 2m0s --- test/e2e/apps/deployment.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/e2e/apps/deployment.go b/test/e2e/apps/deployment.go index cb987e185a5..3225375430b 100644 --- a/test/e2e/apps/deployment.go +++ b/test/e2e/apps/deployment.go @@ -1395,14 +1395,15 @@ func testRollingUpdateDeploymentWithLocalTrafficLoadBalancer(f *framework.Framew } e2eservice.TestReachableHTTP(lbNameOrAddress, svcPort, timeout) + expectedNodes, err := jig.GetEndpointNodeNames() + framework.ExpectNoError(err) + framework.Logf("Starting a goroutine to watch the service's endpoints in the background") done := make(chan struct{}) failed := make(chan struct{}) defer close(done) go func() { defer ginkgo.GinkgoRecover() - expectedNodes, err := jig.GetEndpointNodeNames() - framework.ExpectNoError(err) // The affinity policy should ensure that before an old pod is // deleted, a new pod will have been created on the same node. // Thus the set of nodes with local endpoints for the service