From 860309986217ef1d12dab8a8cc1e561633c1d11d Mon Sep 17 00:00:00 2001 From: iverase Date: Fri, 29 May 2020 10:07:56 +0200 Subject: [PATCH] Make sure we always provide a positive long --- .../test/java/org/elasticsearch/monitor/os/OsStatsTests.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)); } }