diff --git a/server/src/test/java/org/elasticsearch/monitor/os/OsStatsTests.java b/server/src/test/java/org/elasticsearch/monitor/os/OsStatsTests.java index 8581e566cda8e..fabd7ff127adc 100644 --- a/server/src/test/java/org/elasticsearch/monitor/os/OsStatsTests.java +++ b/server/src/test/java/org/elasticsearch/monitor/os/OsStatsTests.java @@ -84,12 +84,12 @@ public void testSerialization() throws IOException { } public void testGetUsedMemoryWithZeroTotal() { - OsStats.Mem mem = new OsStats.Mem(0, randomLong()); + OsStats.Mem mem = new OsStats.Mem(0, randomNonNegativeLong()); assertThat(mem.getUsed().getBytes(), equalTo(0L)); } public void testGetUsedSwapWithZeroTotal() { - OsStats.Swap swap = new OsStats.Swap(0, randomLong()); + OsStats.Swap swap = new OsStats.Swap(0, randomNonNegativeLong()); assertThat(swap.getUsed().getBytes(), equalTo(0L)); } }