Fix InternalTTestTests

`testReduceRandom` was bumping up against the serialization that I added
in #54776. This makes it use random values that reduce in ways that
don't cause the randomized serialization to fail.
This commit is contained in:
Nik Everett 2020-04-07 11:46:04 -04:00
parent a7599031ae
commit faa687c0ae
1 changed files with 7 additions and 1 deletions

View File

@ -51,7 +51,13 @@ public class InternalTTestTests extends InternalAggregationTestCase<InternalTTes
}
private TTestStats randomStats() {
return new TTestStats(randomNonNegativeLong(), randomDouble(), randomDouble());
/*
* Use a count significantly less than Long.MAX_VALUE so the reduce
* phase doesn't wrap to a negative number. If it *did* then we'd
* try to serialize a negative number with writeVLong which throws
* an assertion in tests.
*/
return new TTestStats(randomLongBetween(0, Integer.MAX_VALUE), randomDouble(), randomDouble());
}
@Override