mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-01 16:39:11 +00:00
Tests: Fix edge case in InternalSimpleValueTests (#26084)
When value is NaN, the mutate function might return a new instance that is equal to the original one. * Add same fix for InternalDerivativeTests
This commit is contained in:
parent
99d79d5a0f
commit
729e09ed6e
@ -81,7 +81,11 @@ public class InternalSimpleValueTests extends InternalAggregationTestCase<Intern
|
||||
name += randomAlphaOfLength(5);
|
||||
break;
|
||||
case 1:
|
||||
value += between(1, 100);
|
||||
if (Double.isFinite(value)) {
|
||||
value += between(1, 100);
|
||||
} else {
|
||||
value = randomDoubleBetween(0, 100000, true);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (metaData == null) {
|
||||
|
@ -84,7 +84,11 @@ public class InternalDerivativeTests extends InternalAggregationTestCase<Interna
|
||||
name += randomAlphaOfLength(5);
|
||||
break;
|
||||
case 1:
|
||||
value += between(1, 100);
|
||||
if (Double.isFinite(value)) {
|
||||
value += between(1, 100);
|
||||
} else {
|
||||
value = randomDoubleBetween(0, 100000, true);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
normalizationFactor += between(1, 100);
|
||||
|
Loading…
x
Reference in New Issue
Block a user