Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8246493: JDI stress/serial/mixed002 needs to use WhiteBox.deflateIdle…
…Monitors support

Reviewed-by: cjplummer, sspitsyn
  • Loading branch information
Daniel D. Daugherty committed Jun 30, 2020
1 parent 7c3d72f commit 7d54e71d3875d7289dc35904ac6e03ed9396f2b9
Show file tree
Hide file tree
Showing 12 changed files with 88 additions and 17 deletions.
@@ -128,7 +128,6 @@ vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/Deadlock/JavaDeadlock001/TestD
vmTestbase/nsk/jdi/ThreadReference/stop/stop001/TestDescription.java 7034630 generic-all
vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses021/TestDescription.java 8065773 generic-all
vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses023/TestDescription.java 8065773 generic-all
vmTestbase/nsk/jdi/stress/serial/mixed002/TestDescription.java 8246493 generic-all

vmTestbase/nsk/jdb/eval/eval001/eval001.java 8221503 generic-all

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2020, 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
@@ -37,6 +37,11 @@
*
* @library /vmTestbase
* /test/lib
* @comment some of the tests from forceEarlyReturn001.tests need WhiteBox
* @modules java.base/jdk.internal.misc:+open
* @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox
*
* @run driver jdk.test.lib.FileInstaller . .
*
* @comment build classes required for tests from forceEarlyReturn001.tests
@@ -64,7 +69,8 @@
* -waittime=5
* -debugee.vmkind=java
* -transport.address=dynamic
* "-debugee.vmkeys=${test.vm.opts} ${test.java.opts}"
* "-debugee.vmkeys=-Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+WhiteBoxAPI ${test.vm.opts} ${test.java.opts}"
* -testClassPath ${test.class.path}
* -configFile ./forceEarlyReturn001.tests
*/
@@ -39,6 +39,11 @@
*
* @library /vmTestbase
* /test/lib
* @comment some of the tests from forceEarlyReturn002.tests need WhiteBox
* @modules java.base/jdk.internal.misc:+open
* @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox
*
* @run driver jdk.test.lib.FileInstaller . .
*
* @comment build classes required for tests from forceEarlyReturn002.tests
@@ -66,7 +71,8 @@
* -waittime=5
* -debugee.vmkind=java
* -transport.address=dynamic
* "-debugee.vmkeys=${test.vm.opts} ${test.java.opts}"
* "-debugee.vmkeys=-Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+WhiteBoxAPI ${test.vm.opts} ${test.java.opts}"
* -testClassPath ${test.class.path}
* -configFile ./forceEarlyReturn002.tests
* -testWorkDir .
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2020, 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
@@ -37,6 +37,11 @@
*
* @library /vmTestbase
* /test/lib
* @comment some of the tests from heapwalking001.tests need WhiteBox
* @modules java.base/jdk.internal.misc:+open
* @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox
*
* @run driver jdk.test.lib.FileInstaller . .
*
* @comment build classes required for tests from heapwalking001.tests
@@ -58,7 +63,8 @@
* -waittime=5
* -debugee.vmkind=java
* -transport.address=dynamic
* "-debugee.vmkeys=-Xmx256M ${test.vm.opts} ${test.java.opts}"
* "-debugee.vmkeys=-Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+WhiteBoxAPI -Xmx256M ${test.vm.opts} ${test.java.opts}"
* -testClassPath ${test.class.path}
* -configFile ./heapwalking001.tests
*/
@@ -39,6 +39,11 @@
*
* @library /vmTestbase
* /test/lib
* @comment some of the tests from heapwalking002.tests need WhiteBox
* @modules java.base/jdk.internal.misc:+open
* @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox
*
* @run driver jdk.test.lib.FileInstaller . .
*
* @comment build classes required for tests from heapwalking002.tests
@@ -60,7 +65,8 @@
* -waittime=5
* -debugee.vmkind=java
* -transport.address=dynamic
* "-debugee.vmkeys=-Xmx256M ${test.vm.opts} ${test.java.opts}"
* "-debugee.vmkeys=-Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+WhiteBoxAPI -Xmx256M ${test.vm.opts} ${test.java.opts}"
* -testClassPath ${test.class.path}
* -configFile ./heapwalking002.tests
* -testWorkDir .
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2020, 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
@@ -38,6 +38,11 @@
*
* @library /vmTestbase
* /test/lib
* @comment some of the tests from mixed001.tests need WhiteBox
* @modules java.base/jdk.internal.misc:+open
* @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox
*
* @run driver jdk.test.lib.FileInstaller . .
*
* @comment build classes required for tests from mixed001.tests
@@ -68,7 +73,8 @@
* -waittime=5
* -debugee.vmkind=java
* -transport.address=dynamic
* "-debugee.vmkeys=-Xmx256M ${test.vm.opts} ${test.java.opts}"
* "-debugee.vmkeys=-Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+WhiteBoxAPI -Xmx256M ${test.vm.opts} ${test.java.opts}"
* -testClassPath ${test.class.path}
* -configFile ./mixed001.tests
*/
@@ -40,6 +40,11 @@
*
* @library /vmTestbase
* /test/lib
* @comment some of the tests from mixed002.tests need WhiteBox
* @modules java.base/jdk.internal.misc:+open
* @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox
*
* @run driver jdk.test.lib.FileInstaller . .
*
* @comment build classes required for tests from mixed002.tests
@@ -66,7 +71,8 @@
* -waittime=5
* -debugee.vmkind=java
* -transport.address=dynamic
* "-debugee.vmkeys=-Xmx256M ${test.vm.opts} ${test.java.opts}"
* "-debugee.vmkeys=-Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+WhiteBoxAPI -Xmx256M ${test.vm.opts} ${test.java.opts}"
* -testClassPath ${test.class.path}
* -configFile ./mixed002.tests
* -testWorkDir .
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2020, 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
@@ -38,6 +38,11 @@
*
* @library /vmTestbase
* /test/lib
* @comment some of the tests from monitorEvents001.tests need WhiteBox
* @modules java.base/jdk.internal.misc:+open
* @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox
*
* @run driver jdk.test.lib.FileInstaller . .
*
* @comment build classes required for tests from monitorEvents001.tests
@@ -53,7 +58,8 @@
* -waittime=5
* -debugee.vmkind=java
* -transport.address=dynamic
* "-debugee.vmkeys=${test.vm.opts} ${test.java.opts}"
* "-debugee.vmkeys=-Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+WhiteBoxAPI ${test.vm.opts} ${test.java.opts}"
* -testClassPath ${test.class.path}
* -configFile ./monitorEvents001.tests
*/
@@ -40,6 +40,11 @@
*
* @library /vmTestbase
* /test/lib
* @comment some of the tests from monitorEvents002.tests need WhiteBox
* @modules java.base/jdk.internal.misc:+open
* @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox
*
* @run driver jdk.test.lib.FileInstaller . .
*
* @comment build classes required for tests from monitorEvents002.tests
@@ -55,7 +60,8 @@
* -waittime=5
* -debugee.vmkind=java
* -transport.address=dynamic
* "-debugee.vmkeys=${test.vm.opts} ${test.java.opts}"
* "-debugee.vmkeys=-Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+WhiteBoxAPI ${test.vm.opts} ${test.java.opts}"
* -testClassPath ${test.class.path}
* -configFile ./monitorEvents002.tests
* -testWorkDir .
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2020, 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
@@ -37,6 +37,11 @@
*
* @library /vmTestbase
* /test/lib
* @comment some of the tests from ownedMonitorsAndFrames001.tests need WhiteBox
* @modules java.base/jdk.internal.misc:+open
* @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox
*
* @run driver jdk.test.lib.FileInstaller . .
*
* @comment build classes required for tests from ownedMonitorsAndFrames001.tests
@@ -57,7 +62,8 @@
* -waittime=5
* -debugee.vmkind=java
* -transport.address=dynamic
* "-debugee.vmkeys=${test.vm.opts} ${test.java.opts}"
* "-debugee.vmkeys=-Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+WhiteBoxAPI ${test.vm.opts} ${test.java.opts}"
* -testClassPath ${test.class.path}
* -configFile ./ownedMonitorsAndFrames001.tests
*/
@@ -39,6 +39,11 @@
*
* @library /vmTestbase
* /test/lib
* @comment some of the tests from ownedMonitorsAndFrames002.tests need WhiteBox
* @modules java.base/jdk.internal.misc:+open
* @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox
*
* @run driver jdk.test.lib.FileInstaller . .
*
* @comment build classes required for tests from ownedMonitorsAndFrames002.tests
@@ -61,7 +66,8 @@
* -waittime=5
* -debugee.vmkind=java
* -transport.address=dynamic
* "-debugee.vmkeys=${test.vm.opts} ${test.java.opts}"
* "-debugee.vmkeys=-Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+WhiteBoxAPI ${test.vm.opts} ${test.java.opts}"
* -testClassPath ${test.class.path}
* -configFile ./ownedMonitorsAndFrames002.tests
* -testWorkDir .
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2020, 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,7 @@
import java.io.StreamTokenizer;
import java.io.StringReader;
import nsk.share.Consts;
import sun.hotspot.WhiteBox;

/*
* This class is intended for execution several JDI tests in single VM and used together with nsk.share.jdi.SerialExecutionDebugger
@@ -41,6 +42,8 @@
* For more detailed description of serial test execution see SerialExecutionDebugger
*/
public class SerialExecutionDebuggee extends AbstractJDIDebuggee {
private final WhiteBox WB = WhiteBox.getWhiteBox();

public static void main(String args[]) {
new SerialExecutionDebuggee().doTest(args);
}
@@ -129,6 +132,15 @@ public boolean parseCommand(String command) {
} else if (command.equals(COMMAND_CLEAR_DEBUGGEE)) {
currentDebuggee = null;

// The debuggee can intentionally create inflated monitors.
// With async deflation, this can pin a StateTestThread object
// until the next deflation cycle. This can confuse tests run
// by nsk/jdi/stress/serial/mixed002/TestDescription.java that
// expect only one StateTestThread object to exist in each
// of the debugger tests that mixed002 runs serially in the
// same VM.
WB.deflateIdleMonitors();

return true;
}

0 comments on commit 7d54e71

Please sign in to comment.