8289146: containers/docker/TestMemoryWithCgroupV1.java fails on linux ppc64le machine with missing Memory and Swap Limit output

Reviewed-by: sgehwolf, mdoerr, iklam
This commit is contained in:
Matthias Baesken 2022-07-06 07:12:32 +00:00
parent f783244caf
commit d8f4e97bd3

@ -81,10 +81,19 @@ public class TestMemoryWithCgroupV1 {
Common.addWhiteBoxOpts(opts);
OutputAnalyzer out = Common.run(opts);
out.shouldContain("Memory and Swap Limit is: " + expectedReadLimit)
// in case of warnings like : "Your kernel does not support swap limit
// capabilities or the cgroup is not mounted. Memory limited without swap."
// we only have Memory and Swap Limit is: <huge integer> in the output
try {
out.shouldContain("Memory and Swap Limit is: " + expectedReadLimit)
.shouldContain(
"Memory and Swap Limit has been reset to " + expectedResetLimit + " because swappiness is 0")
.shouldContain("Memory & Swap Limit: " + expectedLimit);
} catch (RuntimeException ex) {
System.out.println("Expected Memory and Swap Limit output missing.");
System.out.println("You may need to add 'cgroup_enable=memory swapaccount=1' to the Linux kernel boot parameters.");
throw ex;
}
}
private static void testOSBeanSwappinessMemory(String memoryAllocation, String swapAllocation,