From 137eb957651cd080b1d41395e5fcd4ef533cd32c Mon Sep 17 00:00:00 2001 From: Zachary Tong Date: Mon, 24 Feb 2020 12:45:30 -0500 Subject: [PATCH] Use newIndexSearcher() to avoid incompatible readers Lucene's `newSearcher()` can generate readers like ParallelCompositeReader which we can't use. We need to instead use our helper `newIndexSearcher` --- .../elasticsearch/search/aggregations/AggregatorTestCase.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/framework/src/main/java/org/elasticsearch/search/aggregations/AggregatorTestCase.java b/test/framework/src/main/java/org/elasticsearch/search/aggregations/AggregatorTestCase.java index 7d0913f3fee0a..bac97f09f437c 100644 --- a/test/framework/src/main/java/org/elasticsearch/search/aggregations/AggregatorTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/search/aggregations/AggregatorTestCase.java @@ -605,7 +605,6 @@ protected AggregationBuilder createAggBuilderForTypeTest(MappedFieldType fieldTy * * Exception types/messages are not currently checked, just presence/absence of an exception. */ - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/52681") public void testSupportedFieldTypes() throws IOException { MapperRegistry mapperRegistry = new IndicesModule(Collections.emptyList()).getMapperRegistry(); Settings settings = Settings.builder().put("index.version.created", Version.CURRENT.id).build(); @@ -647,7 +646,7 @@ public void testSupportedFieldTypes() throws IOException { indexWriter.close(); try (IndexReader indexReader = DirectoryReader.open(directory)) { - IndexSearcher indexSearcher = newSearcher(indexReader, true, true); + IndexSearcher indexSearcher = newIndexSearcher(indexReader); AggregationBuilder aggregationBuilder = createAggBuilderForTypeTest(fieldType, fieldName); // TODO in the future we can make this more explicit with expectThrows(), when the exceptions are standardized