Skip to content

Commit

Permalink
*: avoid flaky test with high load scenario (#57016)
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkingrei authored Oct 31, 2024
1 parent b314a9c commit c240fdf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/statistics/handle/cache/internal/lfu/lfu_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ func TestMemoryControlWithUpdate(t *testing.T) {
t1 := testutil.NewMockStatisticsTable(i, 1, true, false, false)
lfu.Put(1, t1)
}
time.Sleep(1 * time.Second)
require.Equal(t, int64(0), lfu.Cost())
require.Eventually(t, func() bool {
return int64(0) == lfu.Cost()
}, 5*time.Second, 100*time.Millisecond)
}

0 comments on commit c240fdf

Please sign in to comment.