Fix DateHistogramAggregatorTests.testAsSubAgg

Closes #57168 by using `AggregatorTestCase#newIndexSearcher` in the
`AggregatorTestCase#testCase`. Without that global ordinals will
*sometimes* fail to work.
This commit is contained in:
Nik Everett 2020-05-26 14:58:23 -04:00
parent 92e127e90d
commit 0fce2b7713
2 changed files with 1 additions and 7 deletions

View File

@ -171,7 +171,6 @@ public class DateHistogramAggregatorTests extends AggregatorTestCase {
);
}
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/57168")
public void testAsSubAgg() throws IOException {
KeywordFieldMapper.KeywordFieldType k1ft = new KeywordFieldMapper.KeywordFieldType();
k1ft.setName("k1");

View File

@ -557,12 +557,7 @@ public abstract class AggregatorTestCase extends ESTestCase {
try (DirectoryReader unwrapped = DirectoryReader.open(directory);
IndexReader indexReader = wrapDirectoryReader(unwrapped)) {
/*
* Only allow the randomized testing to wrap the reader if
* the test didn't explicitly wrap the reader.
*/
boolean maybeWrap = unwrapped == indexReader;
IndexSearcher indexSearcher = newSearcher(indexReader, maybeWrap, true);
IndexSearcher indexSearcher = newIndexSearcher(indexReader);
V agg = searchAndReduce(indexSearcher, query, aggregationBuilder, fieldTypes);
verify.accept(agg);