Skip to content

Commit 7aa0814

Browse files
authored
Merge pull request #730 from fluxcd/helmrepo-test-flake
helmrepo: Fix test flake in type update test
2 parents 55a594a + b1ae9fc commit 7aa0814

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

controllers/helmrepository_controller_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,9 +1166,11 @@ func TestHelmRepositoryReconciler_ReconcileTypeUpdatePredicateFilter(t *testing.
11661166
Name: secret.Name,
11671167
}
11681168

1169+
oldGen := obj.GetGeneration()
11691170
g.Expect(testEnv.Update(ctx, obj)).To(Succeed())
1171+
newGen := oldGen + 1
11701172

1171-
// Wait for HelmRepository to be Ready
1173+
// Wait for HelmRepository to be Ready with new generation.
11721174
g.Eventually(func() bool {
11731175
if err := testEnv.Get(ctx, key, obj); err != nil {
11741176
return false
@@ -1178,8 +1180,8 @@ func TestHelmRepositoryReconciler_ReconcileTypeUpdatePredicateFilter(t *testing.
11781180
}
11791181
readyCondition := conditions.Get(obj, meta.ReadyCondition)
11801182
return readyCondition.Status == metav1.ConditionTrue &&
1181-
obj.Generation == readyCondition.ObservedGeneration &&
1182-
obj.Generation == obj.Status.ObservedGeneration
1183+
newGen == readyCondition.ObservedGeneration &&
1184+
newGen == obj.Status.ObservedGeneration
11831185
}, timeout).Should(BeTrue())
11841186

11851187
// Check if the object status is valid.

0 commit comments

Comments
 (0)