Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8289146: containers/docker/TestMemoryWithCgroupV1.java fails on linux…
… ppc64le machine with missing Memory and Swap Limit output

Backport-of: d8f4e97bd3f4e50902e80b4b6b4eb3268c6d4a9d
  • Loading branch information
bobpengxie authored and DamonFool committed Sep 12, 2022
1 parent 9767c4c commit 09fe47f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/hotspot/jtreg/containers/docker/TestMemoryWithCgroupV1.java
Expand Up @@ -81,10 +81,19 @@ private static void testMemoryLimitWithSwappiness(String dockerMemLimit, String
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,
Expand Down

1 comment on commit 09fe47f

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.