Skip to content

Commit 74545e2

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 44ca605 commit 74545e2

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
@@ -27,3 +27,6 @@
2727
#
2828
#############################################################################
2929

30+
31+
sun/tools/jhsdb/JShellHeapDumpTest.java 8276539 generic-all
32+
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
@@ -797,6 +797,7 @@ sun/tools/jstat/jstatLineCounts1.sh 8248691,8268211
797797
sun/tools/jstat/jstatLineCounts2.sh 8248691,8268211 linux-ppc64le,aix-ppc64,linux-aarch64
798798
sun/tools/jstat/jstatLineCounts3.sh 8248691,8268211 linux-ppc64le,aix-ppc64,linux-aarch64
799799
sun/tools/jstat/jstatLineCounts4.sh 8248691,8268211 linux-ppc64le,aix-ppc64,linux-aarch64
800+
sun/tools/jhsdb/HeapDumpTestWithActiveProcess.java 8313798 generic-aarch64
800801

801802
############################################################################
802803

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, 2021, 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
@@ -148,7 +148,14 @@ public static void launchJshell() throws IOException {
148148
System.out.println("Starting Jshell");
149149
long startTime = System.currentTimeMillis();
150150
try {
151-
ProcessBuilder pb = new ProcessBuilder(JDKToolFinder.getTestJDKTool("jshell"));
151+
JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jshell");
152+
if (doSleep) {
153+
launcher.addVMArgs(Utils.getTestJavaOpts());
154+
} else {
155+
// Don't allow use of SerialGC. See JDK-8313655.
156+
launcher.addVMArgs(Utils.getFilteredTestJavaOpts("-XX:\\+UseSerialGC"));
157+
}
158+
ProcessBuilder pb = new ProcessBuilder(launcher.getCommand());
152159
jShellProcess = ProcessTools.startProcess("JShell", pb,
153160
s -> { // warm-up predicate
154161
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)