Skip to content

Commit 95a7b39

Browse files
committed
retry reconciliation in delete before finalizer test
Retry reconciliation in `TestImageUpdateAutomationReconciler_deleteBeforeFinalizer` as sometimes it fails with a latest version conflict error. Signed-off-by: Sanskar Jaiswal <[email protected]>
1 parent 6f07aad commit 95a7b39

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

internal/controller/update_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,10 @@ func TestImageUpdateAutomationReconciler_deleteBeforeFinalizer(t *testing.T) {
160160
EventRecorder: record.NewFakeRecorder(32),
161161
}
162162
// NOTE: Only a real API server responds with an error in this scenario.
163-
_, err := r.Reconcile(ctx, ctrl.Request{NamespacedName: client.ObjectKeyFromObject(imageUpdate)})
164-
g.Expect(err).NotTo(HaveOccurred())
163+
g.Eventually(func() error {
164+
_, err := r.Reconcile(ctx, ctrl.Request{NamespacedName: client.ObjectKeyFromObject(imageUpdate)})
165+
return err
166+
}, timeout).Should(Succeed())
165167
}
166168

167169
func TestImageAutomationReconciler_commitMessage(t *testing.T) {

0 commit comments

Comments
 (0)