From 480f3364313cf2f97314d5ffee83e425e45b37d2 Mon Sep 17 00:00:00 2001 From: sendaoYan Date: Tue, 12 Mar 2024 17:06:06 +0800 Subject: [PATCH] 8327946: containers/docker/TestJFREvents.java fails when host kernel config vm.swappiness=0 after 8325139 According to the docker document(https://docs.docker.com/config/containers/resource_constraints/#--memory-swappiness-details), the default value of --memory-swappiness is inherited from the host machine. So, when the the kervel config vm.swappiness=0 on the host machine, this testcase will fail, because of docker container can not use swap memory, the deafult value of --memory-swappiness is 0. Signed-off-by: sendaoYan --- test/hotspot/jtreg/containers/docker/TestJFREvents.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/hotspot/jtreg/containers/docker/TestJFREvents.java b/test/hotspot/jtreg/containers/docker/TestJFREvents.java index 19bbce1c5479c..4a5a4b6cc6ff6 100644 --- a/test/hotspot/jtreg/containers/docker/TestJFREvents.java +++ b/test/hotspot/jtreg/containers/docker/TestJFREvents.java @@ -221,6 +221,8 @@ private static void testSwapMemory(String memValueToSet, String swapValueToSet, commonDockerOpts() .addDockerOpts("--memory=" + memValueToSet) .addDockerOpts("--memory-swap=" + swapValueToSet) + //The default memory-swappiness vaule is inherited from the host machine, which maybe 0 + .addDockerOpts("--memory-swappiness=60") .addClassOptions("jdk.SwapSpace")); out.shouldHaveExitValue(0) .shouldContain("totalSize = " + expectedTotalValue)