Skip to content

Commit aee762e

Browse files
committed
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 <[email protected]>
1 parent ebf902f commit aee762e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/functional/ctlplane/openstackoperator_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1946,8 +1946,8 @@ var _ = Describe("OpenStackOperator controller", func() {
19461946
})
19471947

19481948
It("should have configured nova from the service template", func() {
1949-
OSCtlplane := GetOpenStackControlPlane(names.OpenStackControlplaneName)
19501949
Eventually(func(g Gomega) {
1950+
OSCtlplane := GetOpenStackControlPlane(names.OpenStackControlplaneName)
19511951
OSCtlplane.Spec.Nova.Template.APIDatabaseInstance = "custom-db"
19521952
g.Expect(k8sClient.Update(ctx, OSCtlplane)).Should(Succeed())
19531953
}, timeout, interval).Should(Succeed())

0 commit comments

Comments
 (0)