diff --git a/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/index/store/SearchableSnapshotDirectoryTests.java b/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/index/store/SearchableSnapshotDirectoryTests.java index 5a05b862df1..f3e2ee5b023 100644 --- a/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/index/store/SearchableSnapshotDirectoryTests.java +++ b/x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/index/store/SearchableSnapshotDirectoryTests.java @@ -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,