8231288: "jhsdb jmap" test needed to reproduce issues that used to be reproduced by JShellHeapDumpTest
Reviewed-by: sgehwolf, sspitsyn
This commit is contained in:
parent
b08a8c5cc3
commit
b9bde2ed45
@ -861,6 +861,8 @@ com/sun/jdi/NashornPopFrameTest.java 8187143 generic-
|
||||
sun/tools/jstat/jstatClassloadOutput1.sh 8173942 generic-all
|
||||
sun/tools/jhsdb/BasicLauncherTest.java 8193639,8211767 solaris-all,linux-ppc64,linux-ppc64le
|
||||
sun/tools/jhsdb/HeapDumpTest.java 8193639 solaris-all
|
||||
sun/tools/jhsdb/HeapDumpTestWithActiveProcess.java 8230731,8001227 windows-all
|
||||
sun/tools/jhsdb/HeapDumpTestWithActiveProcess.java 8231635,8231634 generic-all
|
||||
|
||||
|
||||
############################################################################
|
||||
|
31
test/jdk/sun/tools/jhsdb/HeapDumpTestWithActiveProcess.java
Normal file
31
test/jdk/sun/tools/jhsdb/HeapDumpTestWithActiveProcess.java
Normal file
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2019, 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @bug 8230731 8001227 8231635 8231634 8196969
|
||||
* @requires vm.hasSAandCanAttach
|
||||
* @library /test/lib
|
||||
* @compile JShellHeapDumpTest.java
|
||||
* @run main/timeout=240 JShellHeapDumpTest nosleep
|
||||
*/
|
@ -48,7 +48,8 @@ import jdk.jshell.JShell;
|
||||
|
||||
public class JShellHeapDumpTest {
|
||||
|
||||
protected static Process jShellProcess;
|
||||
static Process jShellProcess;
|
||||
static boolean doSleep = true; // By default do a short sleep when app starts up
|
||||
|
||||
public static void launch(String expectedMessage, List<String> toolArgs)
|
||||
throws IOException {
|
||||
@ -141,13 +142,23 @@ public class JShellHeapDumpTest {
|
||||
|
||||
// Give jshell a chance to fully start up. This makes SA more stable for the jmap dump.
|
||||
try {
|
||||
Thread.sleep(2000);
|
||||
if (doSleep) {
|
||||
Thread.sleep(2000);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
||||
if (args.length == 1) {
|
||||
if (args[0].equals("nosleep")) {
|
||||
doSleep = false;
|
||||
} else {
|
||||
throw new RuntimeException("Invalid arg: " + args[0]);
|
||||
}
|
||||
} else if (args.length != 0) {
|
||||
throw new RuntimeException("Too many args: " + args.length);
|
||||
}
|
||||
testHeapDump();
|
||||
|
||||
// The test throws RuntimeException on error.
|
||||
|
Loading…
Reference in New Issue
Block a user