mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-25 09:28:27 +00:00
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:
parent
92e127e90d
commit
0fce2b7713
@ -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");
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user