Skip to content

Commit aa83b01

Browse files
committed
test: fix TestCacheConcurrentWrites race detector flakiness
1 parent b65000d commit aa83b01

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pkg/remoteresolution/resolver/framework/cache/cache_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -534,9 +534,10 @@ func TestCacheConcurrentWrites(t *testing.T) {
534534
}
535535

536536
// We expect at least some recent entries to be cached
537-
// Due to concurrent access and LRU, we use a conservative threshold (at least 20% of the 100 we checked)
538-
if cachedCount < 20 {
539-
t.Errorf("Expected at least 20 recent entries to be cached, but only found %d", cachedCount)
537+
// Due to concurrent access and LRU, we use a conservative threshold (at least 15% of the 100 we checked)
538+
// Lower threshold needed for race detector which runs slower and can cause more evictions
539+
if cachedCount < 15 {
540+
t.Errorf("Expected at least 15 recent entries to be cached, but only found %d", cachedCount)
540541
}
541542
}
542543

0 commit comments

Comments
 (0)