Skip to content

Commit 3f910ff

Browse files
Merge pull request #2122 from abays/fix/openstackversion-galera-update-race
test: fix Galera readiness race in standard and OVN minor updates
2 parents 78f0b11 + b83a1a8 commit 3f910ff

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)