Skip to content

Commit b83a1a8

Browse files
committed
test: avoid Galera generation race during minor update
The OpenStackVersion functional tests simulate Galera readiness after the prior update stage completes. That condition can appear before the control-plane reconcile applies the target MariaDB image to the Galera CR. If the simulation runs first, it records ObservedGeneration for the old spec; the subsequent image patch increments Galera.Generation, invalidating the simulated Ready status and leaving MinorUpdateMariaDB in progress. Wait for the target MariaDB image on the Galera CR before simulating readiness in both minor-update workflows, including the OVN-disabled case.
1 parent 78f0b11 commit b83a1a8

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
@@ -579,6 +579,14 @@ var _ = Describe("OpenStackVersion controller", func() {
579579
k8s_corev1.ConditionFalse,
580580
)
581581

582+
// Wait for the control plane to apply the target image to the Galera CR before
583+
// simulating readiness. Otherwise the controller may update its generation
584+
// after the readiness simulation, leaving the status stale.
585+
Eventually(func(g Gomega) {
586+
galera := mariadb.GetGalera(names.DBName)
587+
g.Expect(galera.Spec.ContainerImage).To(Equal(targetMariaDBVersion))
588+
}, timeout, interval).Should(Succeed())
589+
582590
SimulateGalaraReady()
583591
Eventually(func(g Gomega) {
584592
th.ExpectCondition(
@@ -951,6 +959,14 @@ var _ = Describe("OpenStackVersion controller", func() {
951959
g.Expect(*OSCtlplane.Status.ContainerImages.RabbitmqImage).Should(Equal(targetRabbitMQVersion))
952960
}, timeout*4, interval).Should(Succeed())
953961

962+
// Wait for the control plane to apply the target image to the Galera CR before
963+
// simulating readiness. Otherwise the controller may update its generation
964+
// after the readiness simulation, leaving the status stale.
965+
Eventually(func(g Gomega) {
966+
galera := mariadb.GetGalera(names.DBName)
967+
g.Expect(galera.Spec.ContainerImage).To(Equal(targetMariaDBVersion))
968+
}, timeout, interval).Should(Succeed())
969+
954970
SimulateGalaraReady()
955971
Eventually(func(g Gomega) {
956972
th.ExpectCondition(

0 commit comments

Comments
 (0)