From aee762e0304ef53c848a83910c283da445af636a Mon Sep 17 00:00:00 2001 From: Martin Schuppert Date: Mon, 11 Aug 2025 15:05:01 +0200 Subject: [PATCH] Fix functional test race condition in nova template configuration The "should have configured nova from the service template" test was failing intermittently due to a stale object update pattern. The test was retrieving the OpenStackControlPlane object outside the Eventually block, then attempting to update it inside the block. This could fail with update conflicts if the controller modified the object between retrieval and update. Move GetOpenStackControlPlane() inside the Eventually block to ensure a fresh object is retrieved on each retry attempt, matching the pattern used by other successful tests in the file. Signed-off-by: Martin Schuppert --- tests/functional/ctlplane/openstackoperator_controller_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/functional/ctlplane/openstackoperator_controller_test.go b/tests/functional/ctlplane/openstackoperator_controller_test.go index 03f2e004d3..738fd9acbc 100644 --- a/tests/functional/ctlplane/openstackoperator_controller_test.go +++ b/tests/functional/ctlplane/openstackoperator_controller_test.go @@ -1946,8 +1946,8 @@ var _ = Describe("OpenStackOperator controller", func() { }) It("should have configured nova from the service template", func() { - OSCtlplane := GetOpenStackControlPlane(names.OpenStackControlplaneName) Eventually(func(g Gomega) { + OSCtlplane := GetOpenStackControlPlane(names.OpenStackControlplaneName) OSCtlplane.Spec.Nova.Template.APIDatabaseInstance = "custom-db" g.Expect(k8sClient.Update(ctx, OSCtlplane)).Should(Succeed()) }, timeout, interval).Should(Succeed())