Skip to content

Commit 19d74b4

Browse files
committed
8307408: Some jdk/sun/tools/jhsdb tests don't pass test JVM args to the debuggee JVM
Backport-of: 87b08b6e0192d88025c2275c7dd2c4bdecda58e8
1 parent b806f56 commit 19d74b4

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

test/jdk/ProblemList-zgc.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@
2828
#############################################################################
2929

3030
java/util/concurrent/locks/Lock/OOMEInAQS.java 8309218 generic-all
31+
32+
sun/tools/jhsdb/JShellHeapDumpTest.java 8276539 generic-all
33+
sun/tools/jhsdb/HeapDumpTestWithActiveProcess.java 8276539 generic-all

test/jdk/ProblemList.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,7 @@ sun/tools/jstat/jstatLineCounts3.sh 8248691,8268211
742742
sun/tools/jstat/jstatLineCounts4.sh 8248691,8268211 linux-ppc64le,aix-ppc64,linux-aarch64
743743

744744
sun/tools/jhsdb/JStackStressTest.java 8276210 linux-aarch64
745+
sun/tools/jhsdb/HeapDumpTestWithActiveProcess.java 8313798 generic-aarch64
745746

746747
############################################################################
747748

test/jdk/sun/tools/jhsdb/JShellHeapDumpTest.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -150,7 +150,14 @@ public static void launchJshell() throws IOException {
150150
System.out.println("Starting Jshell");
151151
long startTime = System.currentTimeMillis();
152152
try {
153-
ProcessBuilder pb = new ProcessBuilder(JDKToolFinder.getTestJDKTool("jshell"));
153+
JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jshell");
154+
if (doSleep) {
155+
launcher.addVMArgs(Utils.getTestJavaOpts());
156+
} else {
157+
// Don't allow use of SerialGC. See JDK-8313655.
158+
launcher.addVMArgs(Utils.getFilteredTestJavaOpts("-XX:\\+UseSerialGC"));
159+
}
160+
ProcessBuilder pb = new ProcessBuilder(launcher.getCommand());
154161
jShellProcess = ProcessTools.startProcess("JShell", pb,
155162
s -> { // warm-up predicate
156163
return s.contains("Welcome to JShell");

test/jdk/sun/tools/jhsdb/JStackStressTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -93,7 +93,9 @@ public static void launchJshell() throws IOException {
9393
System.out.println("Starting Jshell");
9494
long startTime = System.currentTimeMillis();
9595
try {
96-
ProcessBuilder pb = new ProcessBuilder(JDKToolFinder.getTestJDKTool("jshell"));
96+
JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jshell");
97+
launcher.addVMArgs(Utils.getTestJavaOpts());
98+
ProcessBuilder pb = new ProcessBuilder(launcher.getCommand());
9799
jShellProcess = ProcessTools.startProcess("JShell", pb);
98100
} catch (Exception ex) {
99101
throw new RuntimeException("Test ERROR " + ex, ex);

0 commit comments

Comments
 (0)