Skip to content

Commit 7a897b3

Browse files
committed
test: wait for target Keystone image before readiness simulation
Wait until the KeystoneAPI CR uses the target image before simulating readiness in both OpenStackVersion minor-update test paths. Previously, readiness was simulated immediately after requesting the new target image. Reconciliation could still be updating the KeystoneAPI CR, then advance its generation after the readiness status was written. That left readiness associated with an older generation and caused the test to time out waiting for the Keystone minor-update condition. Synchronizing on the target image ensures the readiness status applies to the generation under test. Related: OSPRH-38176
1 parent 9dc9fdb commit 7a897b3

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎test/functional/ctlplane/openstackversion_controller_test.go‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,14 @@ var _ = Describe("OpenStackVersion controller", func() {
631631
k8s_corev1.ConditionFalse,
632632
)
633633

634+
// Wait for the control plane to apply the target image to the KeystoneAPI CR before
635+
// simulating readiness. Otherwise the controller may update its generation after
636+
// the readiness simulation, leaving the status stale.
637+
Eventually(func(g Gomega) {
638+
keystoneAPI := keystone.GetKeystoneAPI(names.KeystoneAPIName)
639+
g.Expect(keystoneAPI.Spec.ContainerImage).To(Equal(targetKeystoneAPIVersion))
640+
}, timeout, interval).Should(Succeed())
641+
634642
keystone.SimulateKeystoneAPIReady(names.KeystoneAPIName)
635643
Eventually(func(g Gomega) {
636644
th.ExpectCondition(
@@ -991,6 +999,14 @@ var _ = Describe("OpenStackVersion controller", func() {
991999
g.Expect(*OSCtlplane.Status.ContainerImages.InfraMemcachedImage).Should(Equal(targetMemcachedVersion))
9921000
}, timeout, interval).Should(Succeed())
9931001

1002+
// Wait for the control plane to apply the target image to the KeystoneAPI CR before
1003+
// simulating readiness. Otherwise the controller may update its generation after
1004+
// the readiness simulation, leaving the status stale.
1005+
Eventually(func(g Gomega) {
1006+
keystoneAPI := keystone.GetKeystoneAPI(names.KeystoneAPIName)
1007+
g.Expect(keystoneAPI.Spec.ContainerImage).To(Equal(targetKeystoneAPIVersion))
1008+
}, timeout, interval).Should(Succeed())
1009+
9941010
keystone.SimulateKeystoneAPIReady(names.KeystoneAPIName)
9951011
Eventually(func(g Gomega) {
9961012
th.ExpectCondition(

0 commit comments

Comments
 (0)