Skip to content

Commit 308e8f8

Browse files
authored
Merge pull request #13255 from sbueringer/pr-fix-reconcile-test
🐛 Fix TestReconcile flake
2 parents 2652d8d + 10c4ecb commit 308e8f8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

internal/util/controller/controller_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ func TestReconcile(t *testing.T) {
4242

4343
// reconcileCache has to be created outside synctest.Test, otherwise
4444
// the test would fail because of the cleanup go routine in the cache.
45-
reconcileCache := cache.New[reconcileCacheEntry](cache.DefaultTTL)
45+
// Note: synctest.Test below will run with a fake clock, so it will add
46+
// entries to the cache with a timestamp ~ 2020. We are using a high expiration
47+
// time here so that the cache does not expire our entries during the test run.
48+
reconcileCache := cache.New[reconcileCacheEntry](250 * 365 * 24 * time.Hour) // 250 years
4649

4750
synctest.Test(t, func(t *testing.T) {
4851
g := NewWithT(t)

0 commit comments

Comments
 (0)