From d8f4e97bd3f4e50902e80b4b6b4eb3268c6d4a9d Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Wed, 6 Jul 2022 07:12:32 +0000 Subject: [PATCH] 8289146: containers/docker/TestMemoryWithCgroupV1.java fails on linux ppc64le machine with missing Memory and Swap Limit output Reviewed-by: sgehwolf, mdoerr, iklam --- .../containers/docker/TestMemoryWithCgroupV1.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/hotspot/jtreg/containers/docker/TestMemoryWithCgroupV1.java b/test/hotspot/jtreg/containers/docker/TestMemoryWithCgroupV1.java index 353f8e4ad29..9f73ce41f87 100644 --- a/test/hotspot/jtreg/containers/docker/TestMemoryWithCgroupV1.java +++ b/test/hotspot/jtreg/containers/docker/TestMemoryWithCgroupV1.java @@ -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: 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,