Skip to content

Commit

Permalink
Handle a max memory value of 'max' (#77289)
Browse files Browse the repository at this point in the history
* Handle a max memory value of 'max'

* Update docs/changelog/77289.yaml

* Delete 77289.yaml
  • Loading branch information
pugnascotia authored Sep 6, 2021
1 parent 81cc5cb commit ebf5a92
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,11 @@ public void testOsStats() {
assertThat(stats.getCgroup().getCpuStat().getTimeThrottledNanos(), greaterThanOrEqualTo(0L));
// These could be null if transported from a node running an older version, but shouldn't be null on the current node
assertThat(stats.getCgroup().getMemoryControlGroup(), notNullValue());
assertThat(stats.getCgroup().getMemoryLimitInBytes(), notNullValue());
assertThat(new BigInteger(stats.getCgroup().getMemoryLimitInBytes()), greaterThan(BigInteger.ZERO));
String memoryLimitInBytes = stats.getCgroup().getMemoryLimitInBytes();
assertThat(memoryLimitInBytes, notNullValue());
if (memoryLimitInBytes.equals("max") == false) {
assertThat(new BigInteger(memoryLimitInBytes), greaterThan(BigInteger.ZERO));
}
assertThat(stats.getCgroup().getMemoryUsageInBytes(), notNullValue());
assertThat(new BigInteger(stats.getCgroup().getMemoryUsageInBytes()), greaterThan(BigInteger.ZERO));
}
Expand Down

0 comments on commit ebf5a92

Please sign in to comment.