Skip to content

Commit b256c9a

Browse files
authored
Fix another flaky controller test (#3723)
1 parent 04df525 commit b256c9a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

controllers/reconcile_test.go

+7
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,13 @@ func TestOpenTelemetryCollectorReconciler_Reconcile(t *testing.T) {
648648
if deletionTimestamp != nil {
649649
err := k8sClient.Delete(testContext, &tt.args.params, client.PropagationPolicy(metav1.DeletePropagationForeground))
650650
assert.NoError(t, err)
651+
// wait until the reconciler sees the deletion
652+
assert.EventuallyWithT(t, func(collect *assert.CollectT) {
653+
actual := &v1beta1.OpenTelemetryCollector{}
654+
err := reconciler.Get(testContext, nsn, actual)
655+
assert.NoError(collect, err)
656+
assert.NotNil(t, actual.GetDeletionTimestamp())
657+
}, time.Second*5, time.Millisecond)
651658
}
652659
req := k8sreconcile.Request{
653660
NamespacedName: nsn,

0 commit comments

Comments
 (0)