1
0
Эх сурвалжийг харах

Don't wrap the IndexSearcher in IndexQueryCacheTests (#98781)

concurrent execution is not happy if the given IndexSearcher is wrapped.

fixes https://github.com/elastic/elasticsearch/issues/98776
Ignacio Vera 2 жил өмнө
parent
commit
5dab3b79dd

+ 3 - 3
server/src/test/java/org/elasticsearch/indices/IndicesQueryCacheTests.java

@@ -290,7 +290,7 @@ public class IndicesQueryCacheTests extends ESTestCase {
         w1.close();
         ShardId shard1 = new ShardId("index", "_na_", 0);
         r1 = ElasticsearchDirectoryReader.wrap(r1, shard1);
-        IndexSearcher s1 = newSearcher(r1);
+        IndexSearcher s1 = newSearcher(r1, false);
         s1.setQueryCachingPolicy(TrivialQueryCachingPolicy.ALWAYS);
 
         Directory dir2 = newDirectory();
@@ -300,7 +300,7 @@ public class IndicesQueryCacheTests extends ESTestCase {
         w2.close();
         ShardId shard2 = new ShardId("index", "_na_", 1);
         r2 = ElasticsearchDirectoryReader.wrap(r2, shard2);
-        IndexSearcher s2 = newSearcher(r2);
+        IndexSearcher s2 = newSearcher(r2, false);
         s2.setQueryCachingPolicy(TrivialQueryCachingPolicy.ALWAYS);
 
         Settings settings = Settings.builder()
@@ -375,7 +375,7 @@ public class IndicesQueryCacheTests extends ESTestCase {
         w.close();
         ShardId shard = new ShardId("index", "_na_", 0);
         r = ElasticsearchDirectoryReader.wrap(r, shard);
-        IndexSearcher s = newSearcher(r);
+        IndexSearcher s = newSearcher(r, false);
         s.setQueryCachingPolicy(TrivialQueryCachingPolicy.NEVER);
 
         Settings settings = Settings.builder()