Skip to content

Commit

Permalink
retry reconciliation in delete before finalizer test
Browse files Browse the repository at this point in the history
Retry reconciliation in `TestImageUpdateAutomationReconciler_deleteBeforeFinalizer`
as sometimes it fails with a latest version conflict error.

Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
  • Loading branch information
aryan9600 committed Aug 23, 2023
1 parent fa7441d commit 6d91fb7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/controller/update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,10 @@ func TestImageUpdateAutomationReconciler_deleteBeforeFinalizer(t *testing.T) {
EventRecorder: record.NewFakeRecorder(32),
}
// NOTE: Only a real API server responds with an error in this scenario.
_, err := r.Reconcile(ctx, ctrl.Request{NamespacedName: client.ObjectKeyFromObject(imageUpdate)})
g.Expect(err).NotTo(HaveOccurred())
g.Eventually(func() error {
_, err := r.Reconcile(ctx, ctrl.Request{NamespacedName: client.ObjectKeyFromObject(imageUpdate)})
return err
}, timeout).Should(Succeed())
}

func TestImageAutomationReconciler_commitMessage(t *testing.T) {
Expand Down

0 comments on commit 6d91fb7

Please sign in to comment.