TEST: Use non-zero number for #testCompareUnits
In `ByteSizeValueTests#testCompareUnits`, we expect non-zero for the variable `number` however `randomNonNegativeLong` can return zero. CI: https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+6.2+oracle-java10-periodic/147/console
This commit is contained in:
parent
4ba80a7952
commit
4f644d04a3
|
@ -168,7 +168,7 @@ public class ByteSizeValueTests extends AbstractWireSerializingTestCase<ByteSize
|
|||
}
|
||||
|
||||
public void testCompareUnits() {
|
||||
long number = randomNonNegativeLong() / ByteSizeUnit.PB.toBytes(1);
|
||||
long number = randomLongBetween(1, Long.MAX_VALUE/ ByteSizeUnit.PB.toBytes(1));
|
||||
ByteSizeUnit randomUnit = randomValueOtherThan(ByteSizeUnit.PB, ()->randomFrom(ByteSizeUnit.values()));
|
||||
ByteSizeValue firstByteValue = new ByteSizeValue(number, randomUnit);
|
||||
ByteSizeValue secondByteValue = new ByteSizeValue(number, ByteSizeUnit.PB);
|
||||
|
|
Loading…
Reference in New Issue