Skip to content

Commit af45db6

Browse files
committed
[test] fix mariadb switch account test
In SwitchToNewAccount the resources get simulated to be ready to allow the controller to proceed. At least seen in NovaConduction, this has seen to can happen to be still on the generation before the account switch. This updates the test to wait for cell0 NovaConductor being updated to the new generation before simulate the services to be ready. Signed-off-by: Martin Schuppert <mschuppert@redhat.com>
1 parent e3ba889 commit af45db6

1 file changed

Lines changed: 20 additions & 4 deletions

File tree

test/functional/nova_controller_test.go

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1577,8 +1577,17 @@ var _ = Describe("Nova controller", func() {
15771577

15781578
},
15791579
SwitchToNewAccount: func() {
1580-
SimulateReadyOfNovaTopServices()
1580+
// Wait for cell0 NovaConductor being updated to the new generation before
1581+
// simulate the services to be ready. Otherwise it can happen that the old
1582+
// version gets simulated to be ready and the new generation never reaches
1583+
// the ready state.
1584+
Eventually(func(g Gomega) {
1585+
conductor := GetNovaConductor(cell0.ConductorName)
1586+
g.Expect(conductor.Generation).To(BeNumerically(">", 1))
1587+
g.Expect(conductor.Generation).To(Equal(conductor.Status.ObservedGeneration))
1588+
}, timeout, interval).Should(Succeed())
15811589

1590+
SimulateReadyOfNovaTopServices()
15821591
},
15831592
// delete the CR, allowing tests that exercise finalizer removal
15841593
DeleteCR: func() {
@@ -1697,11 +1706,18 @@ var _ = Describe("Nova controller", func() {
16971706

16981707
},
16991708
SwitchToNewAccount: func() {
1709+
// Wait for cell0 NovaConductor being updated to the new generation before
1710+
// simulate the services to be ready. Otherwise it can happen that the old
1711+
// version gets simulated to be ready and the new generation never reaches
1712+
// the ready state.
1713+
Eventually(func(g Gomega) {
1714+
conductor := GetNovaConductor(cell0.ConductorName)
1715+
g.Expect(conductor.Generation).To(BeNumerically(">", 1))
1716+
g.Expect(conductor.Generation).To(Equal(conductor.Status.ObservedGeneration))
1717+
}, timeout, interval).Should(Succeed())
1718+
17001719
SimulateReadyOfNovaTopServices()
17011720
Eventually(func(g Gomega) {
1702-
th.SimulateJobSuccess(cell0.DBSyncJobName)
1703-
th.SimulateStatefulSetReplicaReady(cell0.ConductorStatefulSetName)
1704-
th.SimulateJobSuccess(cell0.CellMappingJobName)
17051721
nova := GetNova(novaNames.NovaName)
17061722
g.Expect(nova.Status.APIServiceReadyCount).To(Equal(int32(1)))
17071723
g.Expect(nova.Status.SchedulerServiceReadyCount).To(Equal(int32(1)))

0 commit comments

Comments
 (0)