Skip to content

Commit

Permalink
Fix flaky auto_refresh_test (flyteorg#5438)
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Su <[email protected]>
  • Loading branch information
pingsutw authored and robert-ulbrich-mercedes-benz committed Jul 2, 2024
1 parent 4119d8a commit 0e2c7d9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions flytestdlib/cache/auto_refresh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ func TestCacheFour(t *testing.T) {
assert.NoError(t, err)
}

// Wait half a second for all resync periods to complete
time.Sleep(500 * time.Millisecond)
for i := 1; i <= 10; i++ {
item, err := cache.Get(fmt.Sprintf("%d", i))
assert.NoError(t, err)
assert.Equal(t, 10, item.(fakeCacheItem).val)
}
assert.EventuallyWithT(t, func(c *assert.CollectT) {
for i := 1; i <= 10; i++ {
item, err := cache.Get(fmt.Sprintf("%d", i))
assert.NoError(c, err)
assert.Equal(c, 10, item.(fakeCacheItem).val)
}
}, 3*time.Second, 100*time.Millisecond)
cancel()
})

Expand Down

0 comments on commit 0e2c7d9

Please sign in to comment.