From 2b42b7c9e652fe67897d8cb8a03c83f9114325d3 Mon Sep 17 00:00:00 2001 From: SendaoYan Date: Sat, 19 Jul 2025 09:56:50 +0800 Subject: [PATCH 01/11] 8359827: Test runtime/Thread/ThreadCountLimit.java should run exclusively --- .../jtreg/runtime/Thread/{ => stress}/ThreadCountLimit.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename test/hotspot/jtreg/runtime/Thread/{ => stress}/ThreadCountLimit.java (100%) diff --git a/test/hotspot/jtreg/runtime/Thread/ThreadCountLimit.java b/test/hotspot/jtreg/runtime/Thread/stress/ThreadCountLimit.java similarity index 100% rename from test/hotspot/jtreg/runtime/Thread/ThreadCountLimit.java rename to test/hotspot/jtreg/runtime/Thread/stress/ThreadCountLimit.java From 12a1b4c5eb2b260e8163dae94f2a40fb7f9b2afe Mon Sep 17 00:00:00 2001 From: SendaoYan Date: Sat, 19 Jul 2025 10:12:42 +0800 Subject: [PATCH 02/11] add test/hotspot/jtreg/runtime/Thread/stress/TEST.properties --- .../runtime/Thread/stress/TEST.properties | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test/hotspot/jtreg/runtime/Thread/stress/TEST.properties diff --git a/test/hotspot/jtreg/runtime/Thread/stress/TEST.properties b/test/hotspot/jtreg/runtime/Thread/stress/TEST.properties new file mode 100644 index 0000000000000..f18f87ce963f7 --- /dev/null +++ b/test/hotspot/jtreg/runtime/Thread/stress/TEST.properties @@ -0,0 +1,23 @@ +# +# Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# +exclusiveAccess.dirs=. From 3c3c697d62cbaa74c0d4d71977284ca626e74b73 Mon Sep 17 00:00:00 2001 From: SendaoYan Date: Sat, 19 Jul 2025 10:25:36 +0800 Subject: [PATCH 03/11] update TEST.groups --- test/hotspot/jtreg/TEST.groups | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/hotspot/jtreg/TEST.groups b/test/hotspot/jtreg/TEST.groups index 77f49cc2c4786..28724e011b859 100644 --- a/test/hotspot/jtreg/TEST.groups +++ b/test/hotspot/jtreg/TEST.groups @@ -395,7 +395,7 @@ tier1_runtime = \ -runtime/cds/CdsSameObjectAlignment.java \ -runtime/cds/SharedBaseAddress.java \ -runtime/Thread/CancellableThreadTest.java \ - -runtime/Thread/ThreadCountLimit.java \ + -runtime/Thread/stress/ThreadCountLimit.java \ -runtime/Thread/TestThreadDumpMonitorContention.java \ -runtime/Unsafe/RangeCheck.java \ sanity/ \ From 5d6c69bcd54e2bbb5f61d8cce112efef9bc24ad3 Mon Sep 17 00:00:00 2001 From: SendaoYan Date: Mon, 21 Jul 2025 17:13:59 +0800 Subject: [PATCH 04/11] mv test/hotspot/jtreg/runtime/Thread/stress/ThreadCountLimit.java test/hotspot/jtreg/resourcehogs/runtime/Thread/ --- test/hotspot/jtreg/TEST.groups | 1 - .../runtime/Thread}/ThreadCountLimit.java | 0 .../runtime/Thread/stress/TEST.properties | 23 ------------------- 3 files changed, 24 deletions(-) rename test/hotspot/jtreg/{runtime/Thread/stress => resourcehogs/runtime/Thread}/ThreadCountLimit.java (100%) delete mode 100644 test/hotspot/jtreg/runtime/Thread/stress/TEST.properties diff --git a/test/hotspot/jtreg/TEST.groups b/test/hotspot/jtreg/TEST.groups index 28724e011b859..ae99b99bedd1b 100644 --- a/test/hotspot/jtreg/TEST.groups +++ b/test/hotspot/jtreg/TEST.groups @@ -395,7 +395,6 @@ tier1_runtime = \ -runtime/cds/CdsSameObjectAlignment.java \ -runtime/cds/SharedBaseAddress.java \ -runtime/Thread/CancellableThreadTest.java \ - -runtime/Thread/stress/ThreadCountLimit.java \ -runtime/Thread/TestThreadDumpMonitorContention.java \ -runtime/Unsafe/RangeCheck.java \ sanity/ \ diff --git a/test/hotspot/jtreg/runtime/Thread/stress/ThreadCountLimit.java b/test/hotspot/jtreg/resourcehogs/runtime/Thread/ThreadCountLimit.java similarity index 100% rename from test/hotspot/jtreg/runtime/Thread/stress/ThreadCountLimit.java rename to test/hotspot/jtreg/resourcehogs/runtime/Thread/ThreadCountLimit.java diff --git a/test/hotspot/jtreg/runtime/Thread/stress/TEST.properties b/test/hotspot/jtreg/runtime/Thread/stress/TEST.properties deleted file mode 100644 index f18f87ce963f7..0000000000000 --- a/test/hotspot/jtreg/runtime/Thread/stress/TEST.properties +++ /dev/null @@ -1,23 +0,0 @@ -# -# Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -exclusiveAccess.dirs=. From f993419b20b5dd2273a4f6c3c54e79fb8f955383 Mon Sep 17 00:00:00 2001 From: SendaoYan Date: Tue, 22 Jul 2025 18:00:07 +0800 Subject: [PATCH 05/11] Use 'docker run --pids-limit 4096' to instead the original 'ulimit -u 4096' --- test/hotspot/jtreg/TEST.groups | 1 + .../runtime/Thread/ThreadCountLimit.java | 36 +++++++++++++++---- .../test/lib/containers/docker/Common.java | 3 +- 3 files changed, 33 insertions(+), 7 deletions(-) rename test/hotspot/jtreg/{resourcehogs => }/runtime/Thread/ThreadCountLimit.java (78%) diff --git a/test/hotspot/jtreg/TEST.groups b/test/hotspot/jtreg/TEST.groups index ae99b99bedd1b..77f49cc2c4786 100644 --- a/test/hotspot/jtreg/TEST.groups +++ b/test/hotspot/jtreg/TEST.groups @@ -395,6 +395,7 @@ tier1_runtime = \ -runtime/cds/CdsSameObjectAlignment.java \ -runtime/cds/SharedBaseAddress.java \ -runtime/Thread/CancellableThreadTest.java \ + -runtime/Thread/ThreadCountLimit.java \ -runtime/Thread/TestThreadDumpMonitorContention.java \ -runtime/Unsafe/RangeCheck.java \ sanity/ \ diff --git a/test/hotspot/jtreg/resourcehogs/runtime/Thread/ThreadCountLimit.java b/test/hotspot/jtreg/runtime/Thread/ThreadCountLimit.java similarity index 78% rename from test/hotspot/jtreg/resourcehogs/runtime/Thread/ThreadCountLimit.java rename to test/hotspot/jtreg/runtime/Thread/ThreadCountLimit.java index 20d93cbfdbe3a..bc4e5753cc8ba 100644 --- a/test/hotspot/jtreg/resourcehogs/runtime/Thread/ThreadCountLimit.java +++ b/test/hotspot/jtreg/runtime/Thread/ThreadCountLimit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,9 @@ * @summary Stress test that reaches the process limit for thread count, or time limit. * @requires os.family != "aix" * @key stress + * @key cgroups + * @requires container.support + * @requires !vm.asan * @library /test/lib * @run main/othervm -Xmx1g ThreadCountLimit */ @@ -45,6 +48,10 @@ import jdk.test.lib.Platform; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.Utils; +import jdk.test.lib.containers.docker.Common; +import jdk.test.lib.containers.docker.DockerRunOptions; +import jdk.test.lib.containers.docker.DockerTestUtils; public class ThreadCountLimit { @@ -75,12 +82,29 @@ public static void main(String[] args) throws Exception { // which leads to various other failure modes. Run this test with a limit on how many // threads the process is allowed to create, so we hit that limit first. - final String ULIMIT_CMD = "ulimit -u 4096"; - ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(ThreadCountLimit.class.getName()); - String javaCmd = ProcessTools.getCommandLine(pb); // Relaunch the test with args.length > 0, and the ulimit set - ProcessTools.executeCommand("bash", "-c", ULIMIT_CMD + " && " + javaCmd + " dummy") - .shouldHaveExitValue(0); + if (!DockerTestUtils.canTestDocker()) { + return; + } + + String imageName = Common.imageName("threadCountLimit"); + imageName.replace("#", "-"); + System.out.println("Building Docker image: " + imageName); + DockerTestUtils.buildJdkContainerImage(imageName); + + try { + Common.logNewTestCase("Test ThreadCountLimit"); + DockerRunOptions opts = + new DockerRunOptions(imageName, "/jdk/bin/java", ThreadCountLimit.class.getName()); + opts.addDockerOpts("--pids-limit", "4096"); + opts.addDockerOpts("--volume", Utils.TEST_CLASSES + ":/test-classes/"); + opts.addJavaOpts("-cp", "/test-classes/"); + opts.addClassOptions("dummy"); + OutputAnalyzer out = DockerTestUtils.dockerRunJava(opts); + out.shouldHaveExitValue(0); + } finally { + DockerTestUtils.removeDockerImage(imageName); + } } else { // Not Linux so run directly. test(); diff --git a/test/lib/jdk/test/lib/containers/docker/Common.java b/test/lib/jdk/test/lib/containers/docker/Common.java index 2cc0510f3a669..694dcfcbfbd7b 100644 --- a/test/lib/jdk/test/lib/containers/docker/Common.java +++ b/test/lib/jdk/test/lib/containers/docker/Common.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -58,6 +58,7 @@ public static String imageName() { testname = testname.replace(".java", ""); testname = testname.replace('/', '-'); testname = testname.replace('\\', '-'); + testname = testname.replace('#', '-'); // Example: "jdk-internal:test-containers-docker-TestMemoryAwareness" return "jdk-internal:test-" + testname; From 374c297b52b03e8b471465010f99b1b6bc3174f0 Mon Sep 17 00:00:00 2001 From: SendaoYan Date: Tue, 22 Jul 2025 18:07:00 +0800 Subject: [PATCH 06/11] Remove extra whitespaces --- test/hotspot/jtreg/runtime/Thread/ThreadCountLimit.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/hotspot/jtreg/runtime/Thread/ThreadCountLimit.java b/test/hotspot/jtreg/runtime/Thread/ThreadCountLimit.java index bc4e5753cc8ba..47d536f43d712 100644 --- a/test/hotspot/jtreg/runtime/Thread/ThreadCountLimit.java +++ b/test/hotspot/jtreg/runtime/Thread/ThreadCountLimit.java @@ -91,7 +91,7 @@ public static void main(String[] args) throws Exception { imageName.replace("#", "-"); System.out.println("Building Docker image: " + imageName); DockerTestUtils.buildJdkContainerImage(imageName); - + try { Common.logNewTestCase("Test ThreadCountLimit"); DockerRunOptions opts = From 809d3b1721227ef2d7b99603afd3be1d51579919 Mon Sep 17 00:00:00 2001 From: SendaoYan Date: Tue, 22 Jul 2025 20:13:20 +0800 Subject: [PATCH 07/11] Revert "Remove extra whitespaces" This reverts commit 374c297b52b03e8b471465010f99b1b6bc3174f0. --- test/hotspot/jtreg/runtime/Thread/ThreadCountLimit.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/hotspot/jtreg/runtime/Thread/ThreadCountLimit.java b/test/hotspot/jtreg/runtime/Thread/ThreadCountLimit.java index 47d536f43d712..bc4e5753cc8ba 100644 --- a/test/hotspot/jtreg/runtime/Thread/ThreadCountLimit.java +++ b/test/hotspot/jtreg/runtime/Thread/ThreadCountLimit.java @@ -91,7 +91,7 @@ public static void main(String[] args) throws Exception { imageName.replace("#", "-"); System.out.println("Building Docker image: " + imageName); DockerTestUtils.buildJdkContainerImage(imageName); - + try { Common.logNewTestCase("Test ThreadCountLimit"); DockerRunOptions opts = From 77884c21f3901bdc26fbe442e8be695b42059eb8 Mon Sep 17 00:00:00 2001 From: SendaoYan Date: Tue, 22 Jul 2025 20:13:33 +0800 Subject: [PATCH 08/11] Revert "Use 'docker run --pids-limit 4096' to instead the original 'ulimit -u 4096'" This reverts commit f993419b20b5dd2273a4f6c3c54e79fb8f955383. --- test/hotspot/jtreg/TEST.groups | 1 - .../runtime/Thread/ThreadCountLimit.java | 36 ++++--------------- .../test/lib/containers/docker/Common.java | 3 +- 3 files changed, 7 insertions(+), 33 deletions(-) rename test/hotspot/jtreg/{ => resourcehogs}/runtime/Thread/ThreadCountLimit.java (78%) diff --git a/test/hotspot/jtreg/TEST.groups b/test/hotspot/jtreg/TEST.groups index 77f49cc2c4786..ae99b99bedd1b 100644 --- a/test/hotspot/jtreg/TEST.groups +++ b/test/hotspot/jtreg/TEST.groups @@ -395,7 +395,6 @@ tier1_runtime = \ -runtime/cds/CdsSameObjectAlignment.java \ -runtime/cds/SharedBaseAddress.java \ -runtime/Thread/CancellableThreadTest.java \ - -runtime/Thread/ThreadCountLimit.java \ -runtime/Thread/TestThreadDumpMonitorContention.java \ -runtime/Unsafe/RangeCheck.java \ sanity/ \ diff --git a/test/hotspot/jtreg/runtime/Thread/ThreadCountLimit.java b/test/hotspot/jtreg/resourcehogs/runtime/Thread/ThreadCountLimit.java similarity index 78% rename from test/hotspot/jtreg/runtime/Thread/ThreadCountLimit.java rename to test/hotspot/jtreg/resourcehogs/runtime/Thread/ThreadCountLimit.java index bc4e5753cc8ba..20d93cbfdbe3a 100644 --- a/test/hotspot/jtreg/runtime/Thread/ThreadCountLimit.java +++ b/test/hotspot/jtreg/resourcehogs/runtime/Thread/ThreadCountLimit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,9 +26,6 @@ * @summary Stress test that reaches the process limit for thread count, or time limit. * @requires os.family != "aix" * @key stress - * @key cgroups - * @requires container.support - * @requires !vm.asan * @library /test/lib * @run main/othervm -Xmx1g ThreadCountLimit */ @@ -48,10 +45,6 @@ import jdk.test.lib.Platform; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; -import jdk.test.lib.Utils; -import jdk.test.lib.containers.docker.Common; -import jdk.test.lib.containers.docker.DockerRunOptions; -import jdk.test.lib.containers.docker.DockerTestUtils; public class ThreadCountLimit { @@ -82,29 +75,12 @@ public static void main(String[] args) throws Exception { // which leads to various other failure modes. Run this test with a limit on how many // threads the process is allowed to create, so we hit that limit first. + final String ULIMIT_CMD = "ulimit -u 4096"; + ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(ThreadCountLimit.class.getName()); + String javaCmd = ProcessTools.getCommandLine(pb); // Relaunch the test with args.length > 0, and the ulimit set - if (!DockerTestUtils.canTestDocker()) { - return; - } - - String imageName = Common.imageName("threadCountLimit"); - imageName.replace("#", "-"); - System.out.println("Building Docker image: " + imageName); - DockerTestUtils.buildJdkContainerImage(imageName); - - try { - Common.logNewTestCase("Test ThreadCountLimit"); - DockerRunOptions opts = - new DockerRunOptions(imageName, "/jdk/bin/java", ThreadCountLimit.class.getName()); - opts.addDockerOpts("--pids-limit", "4096"); - opts.addDockerOpts("--volume", Utils.TEST_CLASSES + ":/test-classes/"); - opts.addJavaOpts("-cp", "/test-classes/"); - opts.addClassOptions("dummy"); - OutputAnalyzer out = DockerTestUtils.dockerRunJava(opts); - out.shouldHaveExitValue(0); - } finally { - DockerTestUtils.removeDockerImage(imageName); - } + ProcessTools.executeCommand("bash", "-c", ULIMIT_CMD + " && " + javaCmd + " dummy") + .shouldHaveExitValue(0); } else { // Not Linux so run directly. test(); diff --git a/test/lib/jdk/test/lib/containers/docker/Common.java b/test/lib/jdk/test/lib/containers/docker/Common.java index 694dcfcbfbd7b..2cc0510f3a669 100644 --- a/test/lib/jdk/test/lib/containers/docker/Common.java +++ b/test/lib/jdk/test/lib/containers/docker/Common.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -58,7 +58,6 @@ public static String imageName() { testname = testname.replace(".java", ""); testname = testname.replace('/', '-'); testname = testname.replace('\\', '-'); - testname = testname.replace('#', '-'); // Example: "jdk-internal:test-containers-docker-TestMemoryAwareness" return "jdk-internal:test-" + testname; From 7b86e5b636fe4e716596f74f1ed3cd1cd950bcd2 Mon Sep 17 00:00:00 2001 From: SendaoYan Date: Wed, 23 Jul 2025 10:27:33 +0800 Subject: [PATCH 09/11] Increase ulimit -u value to try 10 times --- test/hotspot/jtreg/TEST.groups | 1 + .../runtime/Thread/ThreadCountLimit.java | 27 ++++++++++++++----- 2 files changed, 21 insertions(+), 7 deletions(-) rename test/hotspot/jtreg/{resourcehogs => }/runtime/Thread/ThreadCountLimit.java (79%) diff --git a/test/hotspot/jtreg/TEST.groups b/test/hotspot/jtreg/TEST.groups index ae99b99bedd1b..c065454506eb7 100644 --- a/test/hotspot/jtreg/TEST.groups +++ b/test/hotspot/jtreg/TEST.groups @@ -396,6 +396,7 @@ tier1_runtime = \ -runtime/cds/SharedBaseAddress.java \ -runtime/Thread/CancellableThreadTest.java \ -runtime/Thread/TestThreadDumpMonitorContention.java \ + -runtime/Thread/ThreadCountLimit.java \ -runtime/Unsafe/RangeCheck.java \ sanity/ \ -:tier1_runtime_appcds_exclude \ diff --git a/test/hotspot/jtreg/resourcehogs/runtime/Thread/ThreadCountLimit.java b/test/hotspot/jtreg/runtime/Thread/ThreadCountLimit.java similarity index 79% rename from test/hotspot/jtreg/resourcehogs/runtime/Thread/ThreadCountLimit.java rename to test/hotspot/jtreg/runtime/Thread/ThreadCountLimit.java index 20d93cbfdbe3a..6ef7977ef8c1d 100644 --- a/test/hotspot/jtreg/resourcehogs/runtime/Thread/ThreadCountLimit.java +++ b/test/hotspot/jtreg/runtime/Thread/ThreadCountLimit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -73,14 +73,27 @@ public static void main(String[] args) throws Exception { if (Platform.isLinux()) { // On Linux this test sometimes hits the limit for the maximum number of memory mappings, // which leads to various other failure modes. Run this test with a limit on how many - // threads the process is allowed to create, so we hit that limit first. - - final String ULIMIT_CMD = "ulimit -u 4096"; + // threads the process is allowed to create, so we hit that limit first. What we want is + // for another "limit" processes to be available, but ulimit doesn't work that way and + // if there are already many running processes we could fail to even start the JVM properly. + // So we loop increasing the limit until we get a successful run. This is not foolproof. + int pLimit = 4096; + final String ULIMIT_CMD = "ulimit -u "; ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(ThreadCountLimit.class.getName()); String javaCmd = ProcessTools.getCommandLine(pb); - // Relaunch the test with args.length > 0, and the ulimit set - ProcessTools.executeCommand("bash", "-c", ULIMIT_CMD + " && " + javaCmd + " dummy") - .shouldHaveExitValue(0); + for (int i = 1; i <= 10; i++) { + // Relaunch the test with args.length > 0, and the ulimit set + String cmd = ULIMIT_CMD + Integer.toString(pLimit * i) + " && " + javaCmd + " dummy"; + System.out.println("Trying: bash -c " + cmd); + OutputAnalyzer oa = ProcessTools.executeCommand("bash", "-c", cmd); + int exitValue = oa.getExitValue(); + switch (exitValue) { + case 0: System.out.println("Success!"); return; + case 1: System.out.println("Retry ..."); continue; + default: oa.shouldHaveExitValue(0); // generate error report + } + } + throw new Error("Failed to perform a successful run!"); } else { // Not Linux so run directly. test(); From f49733d779d5f565218ee8e415385bc2102ed7de Mon Sep 17 00:00:00 2001 From: SendaoYan Date: Wed, 23 Jul 2025 10:31:52 +0800 Subject: [PATCH 10/11] Revert change to TEST.groups --- test/hotspot/jtreg/TEST.groups | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/hotspot/jtreg/TEST.groups b/test/hotspot/jtreg/TEST.groups index c065454506eb7..ee3987e9cdba4 100644 --- a/test/hotspot/jtreg/TEST.groups +++ b/test/hotspot/jtreg/TEST.groups @@ -396,8 +396,8 @@ tier1_runtime = \ -runtime/cds/SharedBaseAddress.java \ -runtime/Thread/CancellableThreadTest.java \ -runtime/Thread/TestThreadDumpMonitorContention.java \ - -runtime/Thread/ThreadCountLimit.java \ -runtime/Unsafe/RangeCheck.java \ + -runtime/Thread/ThreadCountLimit.java \ sanity/ \ -:tier1_runtime_appcds_exclude \ -runtime/signal \ From 00cd0abb7326ba592b04d91b28dac797644540b5 Mon Sep 17 00:00:00 2001 From: SendaoYan Date: Wed, 23 Jul 2025 10:35:59 +0800 Subject: [PATCH 11/11] Revert change to TEST.groups --- test/hotspot/jtreg/TEST.groups | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/hotspot/jtreg/TEST.groups b/test/hotspot/jtreg/TEST.groups index ee3987e9cdba4..77f49cc2c4786 100644 --- a/test/hotspot/jtreg/TEST.groups +++ b/test/hotspot/jtreg/TEST.groups @@ -395,9 +395,9 @@ tier1_runtime = \ -runtime/cds/CdsSameObjectAlignment.java \ -runtime/cds/SharedBaseAddress.java \ -runtime/Thread/CancellableThreadTest.java \ + -runtime/Thread/ThreadCountLimit.java \ -runtime/Thread/TestThreadDumpMonitorContention.java \ -runtime/Unsafe/RangeCheck.java \ - -runtime/Thread/ThreadCountLimit.java \ sanity/ \ -:tier1_runtime_appcds_exclude \ -runtime/signal \