Skip to content

Commit b4a6ddd

Browse files
authored
Merge pull request #12617 from sbueringer/pr-fix-flake-reconcile-state
🐛 Fix flaky TestReconcileState unit test
2 parents 71d7193 + a8c616c commit b4a6ddd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

internal/controllers/topology/cluster/reconcile_state_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3662,7 +3662,8 @@ func TestReconcileState(t *testing.T) {
36623662
g.Expect(got.Spec.InfrastructureRef.IsDefined()).To(BeTrue())
36633663
g.Expect(got.Spec.ControlPlaneRef.IsDefined()).To(BeFalse())
36643664

3665-
g.Expect(env.CleanupAndWait(ctx, infrastructureCluster, currentCluster, clusterClass, ict, cpt)).To(Succeed())
3665+
g.Expect(env.CleanupAndWait(ctx, currentCluster)).To(Succeed())
3666+
g.Expect(env.CleanupAndWait(ctx, infrastructureCluster, clusterClass, ict, cpt)).To(Succeed())
36663667
})
36673668
t.Run("Cluster get reconciled with both infrastructure Ref and control plane ref when both reconcileInfrastructureCluster and reconcileControlPlane pass", func(t *testing.T) {
36683669
g := NewWithT(t)
@@ -3722,7 +3723,8 @@ func TestReconcileState(t *testing.T) {
37223723
g.Expect(got.Spec.InfrastructureRef.IsDefined()).To(BeTrue())
37233724
g.Expect(got.Spec.ControlPlaneRef.IsDefined()).To(BeTrue())
37243725

3725-
g.Expect(env.CleanupAndWait(ctx, infrastructureCluster, controlPlane, currentCluster, clusterClass, ict, cpt)).To(Succeed())
3726+
g.Expect(env.CleanupAndWait(ctx, currentCluster)).To(Succeed())
3727+
g.Expect(env.CleanupAndWait(ctx, infrastructureCluster, controlPlane, clusterClass, ict, cpt)).To(Succeed())
37263728
})
37273729
t.Run("Cluster does not get reconciled when reconcileControlPlane fails and infrastructure Ref is set", func(t *testing.T) {
37283730
g := NewWithT(t)

0 commit comments

Comments
 (0)