diff --git a/internal/controller/helmrelease_controller_test.go b/internal/controller/helmrelease_controller_test.go index 75fa2149a..a8ad0f1c9 100644 --- a/internal/controller/helmrelease_controller_test.go +++ b/internal/controller/helmrelease_controller_test.go @@ -852,12 +852,14 @@ func TestHelmReleaseReconciler_reconcileDelete(t *testing.T) { g.Expect(err).To(MatchError(helmdriver.ErrReleaseNotFound)) // Verify Helm chart has been removed. - err = testEnv.Get(context.TODO(), client.ObjectKey{ - Namespace: hc.Namespace, - Name: hc.Name, - }, &sourcev1b2.HelmChart{}) - g.Expect(err).To(HaveOccurred()) - g.Expect(apierrors.IsNotFound(err)).To(BeTrue()) + g.Eventually(func(g Gomega) { + err = testEnv.Get(context.TODO(), client.ObjectKey{ + Namespace: hc.Namespace, + Name: hc.Name, + }, &sourcev1b2.HelmChart{}) + g.Expect(err).To(HaveOccurred()) + g.Expect(apierrors.IsNotFound(err)).To(BeTrue()) + }).Should(Succeed()) }) t.Run("removes finalizer for suspended resource with DeletionTimestamp", func(t *testing.T) {