Skip to content

Commit bf2fb21

Browse files
author
Christoph Büscher
authored
[Tests] Relax allowed delta in extended_stats aggregation (#30569)
The order in which double values are added in java can give different results for the sum, so we need to allow a certain delta in the test assertions. The current value was still a bit too low, resulting in rare test failures. This change increases the allowed margin of error by a factor of ten.
1 parent 50c34b2 commit bf2fb21

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/InternalExtendedStatsTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ protected void assertReduced(InternalExtendedStats reduced, List<InternalExtende
8484
assertEquals(expectedCount, reduced.getCount());
8585
// The order in which you add double values in java can give different results. The difference can
8686
// be larger for large sum values, so we make the delta in the assertion depend on the values magnitude
87-
assertEquals(expectedSum, reduced.getSum(), Math.abs(expectedSum) * 1e-11);
87+
assertEquals(expectedSum, reduced.getSum(), Math.abs(expectedSum) * 1e-10);
8888
assertEquals(expectedMin, reduced.getMin(), 0d);
8989
assertEquals(expectedMax, reduced.getMax(), 0d);
9090
// summing squared values, see reason for delta above

0 commit comments

Comments
 (0)