Closed
Description
DateRangeAggregatorTests#testCase() has the following code in it, which is supposed to change the resolution at which aggregations on date range fields are run:
DateFieldMapper.Builder builder = new DateFieldMapper.Builder(DATE_FIELD_NAME)
.withResolution(resolution);
DateFieldMapper.DateFieldType fieldType = builder.fieldType();
fieldType.setHasDocValues(true);
fieldType.setName(DATE_FIELD_NAME);
However, DateFieldMapper.Builder.withResolution()
doesn't actually make any changes to the underlying MappedFieldType, so this means that tests are always run with the default resolution (Resolution.MILLISECONDS
). The tests fail if the resolution is set explicitly on the fieldtype.
RangeAggregatorTests#testDateFieldNanosecondResolution has the same test bug, and also fails when the fieldType resolution is set correctly.