Skip to content

Commit 65a061e

Browse files
committed
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.
1 parent 33d6a55 commit 65a061e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/index/store/SearchableSnapshotDirectoryTests.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,9 @@ public void testClearCache() throws Exception {
531531
shardId,
532532
Settings.builder()
533533
.put(SNAPSHOT_CACHE_ENABLED_SETTING.getKey(), true)
534-
.put(SNAPSHOT_CACHE_PREWARM_ENABLED_SETTING.getKey(), randomBoolean())
534+
// disable prewarming in this test to prevent files to be concurrently cached
535+
// while the cache is cleared out and while the test verifies it is empty
536+
.put(SNAPSHOT_CACHE_PREWARM_ENABLED_SETTING.getKey(), false)
535537
.build(),
536538
() -> 0L,
537539
cacheService,

0 commit comments

Comments
 (0)