Skip to content

Commit 5a1b5ae

Browse files
authored
[TEST] Increase error bound in flaky test (#97176)
* Use a highly accurate TDigest to compute MAD. MedianAbsoluteDeviation builds a second TDigest over the centroids of the TDigest that's computed over the input. The second TDigest should have only a handful of values, so using an AVLTreeDigest produces more accurate results with no significant performance penalty. Note that the HybridDigest can't use SortingDigest internally for large inputs, even if the number of centroids is fairly small (likely less than 1000). * Update docs/changelog/97176.yaml * Increase error in test. * Delete docs/changelog/97176.yaml
1 parent dc856ac commit 5a1b5ae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/src/test/java/org/elasticsearch/search/aggregations/metrics/MedianAbsoluteDeviationAggregatorTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public void testQueryFiltering() throws IOException {
127127
writer.addDocument(Arrays.asList(new IntPoint(FIELD_NAME, point), new SortedNumericDocValuesField(FIELD_NAME, point)));
128128
}
129129
}, agg -> {
130-
assertThat(agg.getMedianAbsoluteDeviation(), closeToRelative(calculateMAD(filteredSample)));
130+
assertThat(agg.getMedianAbsoluteDeviation(), closeToRelative(calculateMAD(filteredSample), 0.2));
131131
assertTrue(AggregationInspectionHelper.hasValue(agg));
132132
});
133133
}

0 commit comments

Comments
 (0)