Skip to content

Commit

Permalink
Fix AutoDateHistogramAggregatorTests failures (#55947)
Browse files Browse the repository at this point in the history
  • Loading branch information
csoulios committed Apr 29, 2020
1 parent fd554d9 commit f3870e6
Showing 1 changed file with 6 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,20 +220,12 @@ public void testAggregateWrongField() throws IOException {
fieldType.setHasDocValues(true);
fieldType.setName("date_field");

testCase(
aggregation,
DEFAULT_QUERY,
testCase(aggregation, DEFAULT_QUERY,
iw -> {},
(Consumer<InternalAutoDateHistogram>) histogram -> {
// TODO: searchAndReduce incorrectly returns null for empty aggs
assertNull(histogram);
/*
assertEquals(0, histogram.getBuckets().size());
assertFalse(AggregationInspectionHelper.hasValue(histogram));
*/
},
fieldType
);
}, fieldType);
}

public void testUnmappedMissing() throws IOException {
Expand All @@ -245,23 +237,14 @@ public void testUnmappedMissing() throws IOException {
fieldType.setHasDocValues(true);
fieldType.setName("date_field");

testCase(
aggregation,
DEFAULT_QUERY,
testCase(aggregation, DEFAULT_QUERY,
iw -> {},
(Consumer<InternalAutoDateHistogram>) histogram -> {
// TODO: searchAndReduce incorrectly returns null for empty aggs
assertNull(histogram);
/*
assertEquals(1, histogram.getBuckets().size());
assertTrue(AggregationInspectionHelper.hasValue(histogram));
*/
},
fieldType
);
assertEquals(0, histogram.getBuckets().size());
assertFalse(AggregationInspectionHelper.hasValue(histogram));
}, fieldType);
}


public void testIntervalYear() throws IOException {
final long start = LocalDate.of(2015, 1, 1).atStartOfDay(ZoneOffset.UTC).toInstant().toEpochMilli();
final long end = LocalDate.of(2017, 12, 31).atStartOfDay(ZoneOffset.UTC).toInstant().toEpochMilli();
Expand Down

0 comments on commit f3870e6

Please sign in to comment.