Skip to content

Commit

Permalink
Fix OsStatsTests by providing always a positive long (elastic#57336)
Browse files Browse the repository at this point in the history
Make sure we always provide a positive long
  • Loading branch information
iverase authored and danhermann committed May 29, 2020
1 parent 4a5f80a commit c5b19e3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

0 comments on commit c5b19e3

Please sign in to comment.