Fix SearchableSnapshotDirectoryTests.testClearCache (#56277)

This test sometimes fails when prewarming is enabled because 
it's possible that some files are cached in background while the 
test tries to clear the cache. This commit disables prewarming 
for this test.
This commit is contained in:
Tanguy Leroux 2020-05-07 10:58:19 +02:00
parent 33d6a55d1d
commit 65a061e33a
1 changed files with 3 additions and 1 deletions

View File

@ -531,7 +531,9 @@ public class SearchableSnapshotDirectoryTests extends ESTestCase {
shardId,
Settings.builder()
.put(SNAPSHOT_CACHE_ENABLED_SETTING.getKey(), true)
.put(SNAPSHOT_CACHE_PREWARM_ENABLED_SETTING.getKey(), randomBoolean())
// disable prewarming in this test to prevent files to be concurrently cached
// while the cache is cleared out and while the test verifies it is empty
.put(SNAPSHOT_CACHE_PREWARM_ENABLED_SETTING.getKey(), false)
.build(),
() -> 0L,
cacheService,