Skip to content

Commit d9e44b7

Browse files
committed
fix: flaky test
1 parent 1e26d40 commit d9e44b7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

exp/runtime/internal/controllers/extensionconfig_controller_test.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,19 @@ func TestExtensionReconciler_Reconcile(t *testing.T) {
119119
pausedCondition := v1beta2conditions.Get(conf, clusterv1.PausedV1Beta2Condition)
120120
g.Expect(pausedCondition).ToNot(BeNil())
121121
g.Expect(pausedCondition.ObservedGeneration).To(Equal(conf.Generation))
122-
}).WithTimeout(10 * time.Second).WithPolling(100 * time.Millisecond).Should(Succeed())
122+
}).WithTimeout(15 * time.Second).WithPolling(100 * time.Millisecond).Should(Succeed())
123123

124124
_, err = r.Reconcile(ctx, ctrl.Request{NamespacedName: util.ObjectKey(extensionConfig)})
125125
g.Expect(err).ToNot(HaveOccurred())
126126

127+
// Wait for discovery to complete before checking final conditions
128+
g.Eventually(func(g Gomega) {
129+
updatedConfig := &runtimev1.ExtensionConfig{}
130+
g.Expect(env.GetAPIReader().Get(ctx, util.ObjectKey(extensionConfig), updatedConfig)).To(Succeed())
131+
v1beta2Conditions := updatedConfig.GetV1Beta2Conditions()
132+
g.Expect(len(v1beta2Conditions)).To(BeNumerically(">=", 2))
133+
}).WithTimeout(10 * time.Second).WithPolling(100 * time.Millisecond).Should(Succeed())
134+
127135
config := &runtimev1.ExtensionConfig{}
128136
g.Expect(env.GetAPIReader().Get(ctx, util.ObjectKey(extensionConfig), config)).To(Succeed())
129137

0 commit comments

Comments
 (0)