[Tests] Relax allowed delta in extended_stats aggregation (#27171)

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, which manifested itself in occasional
test failures.
This commit is contained in:
Christoph Büscher 2017-11-10 14:37:26 +01:00 committed by GitHub
parent 9c4d6c629a
commit 4fa33e7111
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -82,7 +82,7 @@ public class InternalExtendedStatsTests extends InternalAggregationTestCase<Inte
assertEquals(expectedCount, reduced.getCount());
// The order in which you add double values in java can give different results. The difference can
// be larger for large sum values, so we make the delta in the assertion depend on the values magnitude
assertEquals(expectedSum, reduced.getSum(), Math.abs(expectedSum) * 1e-12);
assertEquals(expectedSum, reduced.getSum(), Math.abs(expectedSum) * 1e-11);
assertEquals(expectedMin, reduced.getMin(), 0d);
assertEquals(expectedMax, reduced.getMax(), 0d);
// summing squared values, see reason for delta above