diff --git a/test/hotspot/jtreg/runtime/coroutine/AvoidDeoptCoroutineMethodTest.java b/test/hotspot/jtreg/runtime/coroutine/AvoidDeoptCoroutineMethodTest.java deleted file mode 100644 index c90eac95d7a..00000000000 --- a/test/hotspot/jtreg/runtime/coroutine/AvoidDeoptCoroutineMethodTest.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * @test TestAvoidDeoptCoroutineMethod - * @library /test/lib - * @build sun.hotspot.WhiteBox - * @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox - * @build AvoidDeoptCoroutineMethodTest - * @run main/othervm -XX:+EnableCoroutine -Xmx10m -Xms10m -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI AvoidDeoptCoroutineMethodTest - * @summary test avoid coroutine intrinsic method to be deoptimized - */ - -import sun.hotspot.WhiteBox; -import java.dyn.Coroutine; -import java.io.*; - -public class AvoidDeoptCoroutineMethodTest { - public static void main(String[] args) throws Exception { - WhiteBox whiteBox = WhiteBox.getWhiteBox(); - Coroutine threadCoro = Thread.currentThread().getCoroutineSupport().threadCoroutine(); - runSomeCoroutines(threadCoro); - // deoptimize all - whiteBox.deoptimizeAll(); - // if intrinsic methods of coroutine have been deoptimized, it will crash here - runSomeCoroutines(threadCoro); - } - - private static void runSomeCoroutines(Coroutine threadCoro) throws Exception { - for (int i = 0; i < 10000; i++) { - new Coroutine(() -> {}); - Coroutine.yieldTo(threadCoro); // switch to new created coroutine and let it die - } - System.out.println("end of run"); - } -} - diff --git a/test/hotspot/jtreg/runtime/coroutine/C1ThrowSyncExceptionTest.java b/test/hotspot/jtreg/runtime/coroutine/TestC1ThrowSyncException.java similarity index 96% rename from test/hotspot/jtreg/runtime/coroutine/C1ThrowSyncExceptionTest.java rename to test/hotspot/jtreg/runtime/coroutine/TestC1ThrowSyncException.java index 53532d5aa26..1e12b26fb29 100644 --- a/test/hotspot/jtreg/runtime/coroutine/C1ThrowSyncExceptionTest.java +++ b/test/hotspot/jtreg/runtime/coroutine/TestC1ThrowSyncException.java @@ -2,7 +2,7 @@ * @test * @summary test a special wisp unpark case for C1 compiled method * @modules java.base/jdk.internal.access - * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.transparentAsync=true -XX:TieredStopAtLevel=1 C1ThrowSyncExceptionTest + * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.transparentAsync=true -XX:TieredStopAtLevel=1 TestC1ThrowSyncException */ @@ -18,7 +18,7 @@ import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; -public class C1ThrowSyncExceptionTest { +public class TestC1ThrowSyncException { final static Runner[] runners = new Runner[16]; static boolean JUC; static final int N = 40000; diff --git a/test/hotspot/jtreg/runtime/coroutine/DirectUnparkTest.java b/test/hotspot/jtreg/runtime/coroutine/TestDirectUnpark.java similarity index 90% rename from test/hotspot/jtreg/runtime/coroutine/DirectUnparkTest.java rename to test/hotspot/jtreg/runtime/coroutine/TestDirectUnpark.java index 8fa388635db..06c77175187 100644 --- a/test/hotspot/jtreg/runtime/coroutine/DirectUnparkTest.java +++ b/test/hotspot/jtreg/runtime/coroutine/TestDirectUnpark.java @@ -2,8 +2,8 @@ * @test * @library /test/lib * @summary Test the optimization of direct unpark with Object.wait/notify - * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.enableThreadAsWisp=true -Dcom.alibaba.wisp.version=2 -Dcom.alibaba.wisp.allThreadAsWisp=true DirectUnparkTest - * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.enableThreadAsWisp=true -Dcom.alibaba.wisp.version=2 DirectUnparkTest + * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.enableThreadAsWisp=true -Dcom.alibaba.wisp.version=2 -Dcom.alibaba.wisp.allThreadAsWisp=true TestDirectUnpark + * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.enableThreadAsWisp=true -Dcom.alibaba.wisp.version=2 TestDirectUnpark */ import com.alibaba.wisp.engine.WispEngine; @@ -12,9 +12,9 @@ import static jdk.test.lib.Asserts.*; -public class DirectUnparkTest { +public class TestDirectUnpark { public static void main(String[] args) throws Exception { - DirectUnparkTest s = new DirectUnparkTest(); + TestDirectUnpark s = new TestDirectUnpark(); WispEngine.dispatch(s::bar); long now = System.currentTimeMillis(); synchronized (s) { diff --git a/test/hotspot/jtreg/runtime/coroutine/InterruptedWaitTest.java b/test/hotspot/jtreg/runtime/coroutine/TestInterruptedWait.java similarity index 87% rename from test/hotspot/jtreg/runtime/coroutine/InterruptedWaitTest.java rename to test/hotspot/jtreg/runtime/coroutine/TestInterruptedWait.java index 02943ed8196..a9d265887e3 100644 --- a/test/hotspot/jtreg/runtime/coroutine/InterruptedWaitTest.java +++ b/test/hotspot/jtreg/runtime/coroutine/TestInterruptedWait.java @@ -2,15 +2,15 @@ * @test * @summary test obj.wait() could be interrupted * @library /test/lib - * @run main/othervm -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true InterruptedWaitTest - * @run main/othervm -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 InterruptedWaitTest + * @run main/othervm -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true TestInterruptedWait + * @run main/othervm -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestInterruptedWait */ import java.util.concurrent.atomic.AtomicBoolean; import static jdk.test.lib.Asserts.*; -public class InterruptedWaitTest { +public class TestInterruptedWait { public static void main(String[] args) throws Exception { AtomicBoolean interrupted = new AtomicBoolean(false); Thread t = new Thread(() -> { diff --git a/test/hotspot/jtreg/runtime/coroutine/JStackTest.java b/test/hotspot/jtreg/runtime/coroutine/TestJStack.java similarity index 98% rename from test/hotspot/jtreg/runtime/coroutine/JStackTest.java rename to test/hotspot/jtreg/runtime/coroutine/TestJStack.java index c5a4e789ffd..850b04b42cc 100644 --- a/test/hotspot/jtreg/runtime/coroutine/JStackTest.java +++ b/test/hotspot/jtreg/runtime/coroutine/TestJStack.java @@ -4,7 +4,7 @@ * @summary Test jstack steal counter * @modules java.base/com.alibaba.wisp.engine:+open * @modules java.base/java.dyn:+open - * @run main/othervm -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.transparentAsync=true -Dcom.alibaba.wisp.version=2 -XX:ActiveProcessorCount=2 JStackTest + * @run main/othervm -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.transparentAsync=true -Dcom.alibaba.wisp.version=2 -XX:ActiveProcessorCount=2 TestJStack */ import com.alibaba.wisp.engine.WispEngine; @@ -26,7 +26,7 @@ import static jdk.test.lib.Asserts.*; -public class JStackTest { +public class TestJStack { private static Field wisptask = null; private static Field stealCount = null; diff --git a/test/hotspot/jtreg/runtime/coroutine/MemLeakTest.java b/test/hotspot/jtreg/runtime/coroutine/TestMemLeak.java similarity index 97% rename from test/hotspot/jtreg/runtime/coroutine/MemLeakTest.java rename to test/hotspot/jtreg/runtime/coroutine/TestMemLeak.java index e9d4a9aa60f..e15daf98b33 100644 --- a/test/hotspot/jtreg/runtime/coroutine/MemLeakTest.java +++ b/test/hotspot/jtreg/runtime/coroutine/TestMemLeak.java @@ -1,13 +1,13 @@ /* * @test * @summary test of memory leak while creating and destroying coroutine/thread - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.version=2 -Xmx10m -Xms10m MemLeakTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.version=2 -Xmx10m -Xms10m TestMemLeak */ import java.dyn.Coroutine; import java.io.*; -public class MemLeakTest { +public class TestMemLeak { private final static Runnable r = () -> {}; public static void main(String[] args) throws Exception { diff --git a/test/hotspot/jtreg/runtime/coroutine/MultiCoroutineStackTest.java b/test/hotspot/jtreg/runtime/coroutine/TestMultiCoroutineStack.java similarity index 93% rename from test/hotspot/jtreg/runtime/coroutine/MultiCoroutineStackTest.java rename to test/hotspot/jtreg/runtime/coroutine/TestMultiCoroutineStack.java index 769095f6a65..e4745183181 100644 --- a/test/hotspot/jtreg/runtime/coroutine/MultiCoroutineStackTest.java +++ b/test/hotspot/jtreg/runtime/coroutine/TestMultiCoroutineStack.java @@ -2,7 +2,7 @@ * @test * @library /test/lib * @summary Test jstack coroutine output - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.transparentAsync=true -XX:+UseWispMonitor MultiCoroutineStackTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.transparentAsync=true -XX:+UseWispMonitor TestMultiCoroutineStack */ import com.alibaba.wisp.engine.WispEngine; @@ -18,7 +18,7 @@ import static jdk.test.lib.Asserts.*; -public class MultiCoroutineStackTest { +public class TestMultiCoroutineStack { public static void main(String[] args) throws Exception { baseTest(); testCoroutineName(); @@ -51,12 +51,12 @@ private static void testParkingObj() throws Exception { WispEngine.dispatch(() -> { coro[0] = Thread.currentThread(); - LockSupport.park(new MultiCoroutineStackTest()); + LockSupport.park(new TestMultiCoroutineStack()); }); boolean success = false; for (String line : jstack()) { - if (line.contains("parking to wait for") && line.contains(MultiCoroutineStackTest.class.getSimpleName())) { + if (line.contains("parking to wait for") && line.contains(TestMultiCoroutineStack.class.getSimpleName())) { success = true; break; } @@ -66,7 +66,7 @@ private static void testParkingObj() throws Exception { } private static void testWaitingToLock() throws Exception { - Object lock = new MultiCoroutineStackTest(); + Object lock = new TestMultiCoroutineStack(); synchronized (lock) { WispEngine.dispatch(() -> { @@ -75,7 +75,7 @@ private static void testWaitingToLock() throws Exception { }); boolean success = false; for (String line : jstack()) { - if (line.contains("waiting to lock") && line.contains(MultiCoroutineStackTest.class.getSimpleName())) { + if (line.contains("waiting to lock") && line.contains(TestMultiCoroutineStack.class.getSimpleName())) { success = true; break; } diff --git a/test/hotspot/jtreg/runtime/coroutine/PremainWithWispMonitorTest.java b/test/hotspot/jtreg/runtime/coroutine/TestPremainWithWispMonitor.java similarity index 93% rename from test/hotspot/jtreg/runtime/coroutine/PremainWithWispMonitorTest.java rename to test/hotspot/jtreg/runtime/coroutine/TestPremainWithWispMonitor.java index b82ba5e04c1..e1c63458230 100644 --- a/test/hotspot/jtreg/runtime/coroutine/PremainWithWispMonitorTest.java +++ b/test/hotspot/jtreg/runtime/coroutine/TestPremainWithWispMonitor.java @@ -2,14 +2,14 @@ * @test * @summary Test the fix that unpark might not be handled in WispThread::unpark due to due to WispEngine of main thread not properly been initialized in premain(). * - * @run shell premainWithWispMonitorTest.sh + * @run shell testPremainWithWispMonitor.sh */ import com.alibaba.wisp.engine.WispEngine; import java.lang.instrument.Instrumentation; -public class PremainWithWispMonitorTest { +public class TestPremainWithWispMonitor { private static Object lock = new Object(); diff --git a/test/hotspot/jtreg/runtime/coroutine/ReservedStackTest.sh b/test/hotspot/jtreg/runtime/coroutine/TestReservedStack.sh similarity index 98% rename from test/hotspot/jtreg/runtime/coroutine/ReservedStackTest.sh rename to test/hotspot/jtreg/runtime/coroutine/TestReservedStack.sh index 2c684d7f09b..5a1bb1c6cea 100644 --- a/test/hotspot/jtreg/runtime/coroutine/ReservedStackTest.sh +++ b/test/hotspot/jtreg/runtime/coroutine/TestReservedStack.sh @@ -5,7 +5,7 @@ ## @requires vm.opt.DeoptimizeALot == null | vm.opt.DeoptimizeALot == false ## @library /test/lib ## @summary test \@ReservedStackAccess -## @run shell ReservedStackTest.sh +## @run shell TestReservedStack.sh set -x diff --git a/test/hotspot/jtreg/runtime/coroutine/SimpleWispTest.java b/test/hotspot/jtreg/runtime/coroutine/TestSimpleWisp.java similarity index 83% rename from test/hotspot/jtreg/runtime/coroutine/SimpleWispTest.java rename to test/hotspot/jtreg/runtime/coroutine/TestSimpleWisp.java index b3fe1959c39..aec7016b4a8 100644 --- a/test/hotspot/jtreg/runtime/coroutine/SimpleWispTest.java +++ b/test/hotspot/jtreg/runtime/coroutine/TestSimpleWisp.java @@ -1,6 +1,6 @@ import com.alibaba.wisp.engine.WispEngine; -public class SimpleWispTest { +public class TestSimpleWisp { public static void main(String[] args) { diff --git a/test/hotspot/jtreg/runtime/coroutine/Wisp2SwitchTest.java b/test/hotspot/jtreg/runtime/coroutine/TestWisp2Switch.java similarity index 93% rename from test/hotspot/jtreg/runtime/coroutine/Wisp2SwitchTest.java rename to test/hotspot/jtreg/runtime/coroutine/TestWisp2Switch.java index b581d756666..f0300b37b05 100644 --- a/test/hotspot/jtreg/runtime/coroutine/Wisp2SwitchTest.java +++ b/test/hotspot/jtreg/runtime/coroutine/TestWisp2Switch.java @@ -4,7 +4,7 @@ * @library /test/lib * @modules java.base/jdk.internal.access * @modules java.base/com.alibaba.wisp.engine:+open - * @run main/othervm -XX:+UseWisp2 Wisp2SwitchTest + * @run main/othervm -XX:+UseWisp2 TestWisp2Switch */ @@ -14,7 +14,7 @@ import java.lang.reflect.Field; import static jdk.test.lib.Asserts.*; -public class Wisp2SwitchTest { +public class TestWisp2Switch { public static void main(String[] args) throws Exception { WispEngine.dispatch(() -> { for (int i = 0; i < 9999999; i++) { @@ -26,7 +26,7 @@ public static void main(String[] args) throws Exception { } } }); - System.out.println("Wisp2SwitchTest.main"); + System.out.println("TestWisp2Switch.main"); Field f = Class.forName("com.alibaba.wisp.engine.WispConfiguration").getDeclaredField("WISP_VERSION"); f.setAccessible(true); int version = f.getInt(null); diff --git a/test/hotspot/jtreg/runtime/coroutine/Wisp2SwitchTest2.java b/test/hotspot/jtreg/runtime/coroutine/TestWisp2Switch2.java similarity index 97% rename from test/hotspot/jtreg/runtime/coroutine/Wisp2SwitchTest2.java rename to test/hotspot/jtreg/runtime/coroutine/TestWisp2Switch2.java index c7214c92980..44937ba2e59 100644 --- a/test/hotspot/jtreg/runtime/coroutine/Wisp2SwitchTest2.java +++ b/test/hotspot/jtreg/runtime/coroutine/TestWisp2Switch2.java @@ -4,7 +4,7 @@ * @library /test/lib * @modules java.base/jdk.internal.access * @modules java.base/com.alibaba.wisp.engine:+open - * @run main/othervm -XX:+UseWisp2 -Dcom.alibaba.wisp.allThreadAsWisp=false Wisp2SwitchTest2 + * @run main/othervm -XX:+UseWisp2 -Dcom.alibaba.wisp.allThreadAsWisp=false TestWisp2Switch2 */ @@ -15,7 +15,7 @@ import static jdk.test.lib.Asserts.*; -public class Wisp2SwitchTest2 { +public class TestWisp2Switch2 { public static void main(String[] args) throws Exception { WispEngine.dispatch(() -> { for (int i = 0; i < 9999999; i++) { diff --git a/test/hotspot/jtreg/runtime/coroutine/WispClinitTest.java b/test/hotspot/jtreg/runtime/coroutine/TestWispClinit.java similarity index 93% rename from test/hotspot/jtreg/runtime/coroutine/WispClinitTest.java rename to test/hotspot/jtreg/runtime/coroutine/TestWispClinit.java index 73dd4edd445..f5e76fb53e1 100644 --- a/test/hotspot/jtreg/runtime/coroutine/WispClinitTest.java +++ b/test/hotspot/jtreg/runtime/coroutine/TestWispClinit.java @@ -2,14 +2,14 @@ * @test * @library /test/lib * @summary test clinit wait in coroutine - * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true WispClinitTest + * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true TestWispClinit */ import com.alibaba.wisp.engine.WispEngine; import static jdk.test.lib.Asserts.assertTrue; -public class WispClinitTest { +public class TestWispClinit { public static void main(String[] args) { WispEngine.dispatch(C::ensureInit); assertTrue(C.initDone); diff --git a/test/hotspot/jtreg/runtime/coroutine/WispEmitNewGuardTest.java b/test/hotspot/jtreg/runtime/coroutine/TestWispEmitNewGuard.java similarity index 74% rename from test/hotspot/jtreg/runtime/coroutine/WispEmitNewGuardTest.java rename to test/hotspot/jtreg/runtime/coroutine/TestWispEmitNewGuard.java index 478e6c72fe1..3d7c4963f25 100644 --- a/test/hotspot/jtreg/runtime/coroutine/WispEmitNewGuardTest.java +++ b/test/hotspot/jtreg/runtime/coroutine/TestWispEmitNewGuard.java @@ -2,13 +2,13 @@ * @test * @library /testlibrary * @summary test emit_guard_for_new in C2 will add control for load - * @run main/othervm -Xcomp -XX:-TieredCompilation -Xbatch -XX:CompileOnly=WispEmitNewGuardTest.testMethod -XX:+PrintCompilation -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true WispEmitNewGuardTest + * @run main/othervm -Xcomp -XX:-TieredCompilation -Xbatch -XX:CompileOnly=TestWispEmitNewGuard.testMethod -XX:+PrintCompilation -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true TestWispEmitNewGuard */ import com.alibaba.wisp.engine.WispEngine; -public class WispEmitNewGuardTest { +public class TestWispEmitNewGuard { static { System.out.println("================ static initialize ================"); testMethod(); @@ -19,12 +19,12 @@ public static void main(String[] args) throws Exception{ } public static int testMethod() { - WispEmitNewGuardTest x = new WispEmitNewGuardTest(42); + TestWispEmitNewGuard x = new TestWispEmitNewGuard(42); return x.value(); } private int value; - WispEmitNewGuardTest(int value) { + TestWispEmitNewGuard(int value) { this.value = value; } diff --git a/test/hotspot/jtreg/runtime/coroutine/WispPreemptBugTest.java b/test/hotspot/jtreg/runtime/coroutine/TestWispPreemptBug.java similarity index 88% rename from test/hotspot/jtreg/runtime/coroutine/WispPreemptBugTest.java rename to test/hotspot/jtreg/runtime/coroutine/TestWispPreemptBug.java index 4edb751dbea..b4094ae06bc 100644 --- a/test/hotspot/jtreg/runtime/coroutine/WispPreemptBugTest.java +++ b/test/hotspot/jtreg/runtime/coroutine/TestWispPreemptBug.java @@ -1,7 +1,7 @@ /* * @test * @summary verify vm not crash when we're preempted frequently - * @run main/othervm -XX:ActiveProcessorCount=1 -XX:+UseWisp2 WispPreemptBugTest + * @run main/othervm -XX:ActiveProcessorCount=1 -XX:+UseWisp2 TestWispPreemptBug */ import java.security.MessageDigest; @@ -9,7 +9,7 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -public class WispPreemptBugTest { +public class TestWispPreemptBug { public static void main(String[] args) throws Exception { final int TIMEOUT = 3000; diff --git a/test/hotspot/jtreg/runtime/coroutine/c1AssertFailTest.sh b/test/hotspot/jtreg/runtime/coroutine/testC1AssertFail.sh similarity index 91% rename from test/hotspot/jtreg/runtime/coroutine/c1AssertFailTest.sh rename to test/hotspot/jtreg/runtime/coroutine/testC1AssertFail.sh index 721eda72ae5..39ad9c49b8e 100644 --- a/test/hotspot/jtreg/runtime/coroutine/c1AssertFailTest.sh +++ b/test/hotspot/jtreg/runtime/coroutine/testC1AssertFail.sh @@ -3,7 +3,7 @@ ## @test ## ## @summary test c1 assertion failure when UseDirectUnpark is enabled (please run it in slowdebug ver.) -## @run shell c1AssertFailTest.sh +## @run shell testC1AssertFail.sh ${TESTJAVA}/bin/java -Xcomp -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.transparentAsync=true & diff --git a/test/hotspot/jtreg/runtime/coroutine/coroutineBreakpointSwitchToTest.c b/test/hotspot/jtreg/runtime/coroutine/testCoroutineBreakpointSwitchTo.c similarity index 100% rename from test/hotspot/jtreg/runtime/coroutine/coroutineBreakpointSwitchToTest.c rename to test/hotspot/jtreg/runtime/coroutine/testCoroutineBreakpointSwitchTo.c diff --git a/test/hotspot/jtreg/runtime/coroutine/coroutineBreakpointSwitchToTest.sh b/test/hotspot/jtreg/runtime/coroutine/testCoroutineBreakpointSwitchTo.sh similarity index 83% rename from test/hotspot/jtreg/runtime/coroutine/coroutineBreakpointSwitchToTest.sh rename to test/hotspot/jtreg/runtime/coroutine/testCoroutineBreakpointSwitchTo.sh index 3a195aacb61..83537f8e1cb 100644 --- a/test/hotspot/jtreg/runtime/coroutine/coroutineBreakpointSwitchToTest.sh +++ b/test/hotspot/jtreg/runtime/coroutine/testCoroutineBreakpointSwitchTo.sh @@ -3,10 +3,10 @@ # # @test # @library /testlibrary -# @compile SimpleWispTest.java +# @compile TestSimpleWisp.java # # @summary test Coroutine SwitchTo() crash problem -# @run shell coroutineBreakpointSwitchToTest.sh +# @run shell testCoroutineBreakpointSwitchTo.sh # OS=`uname -s` @@ -38,8 +38,8 @@ fi gcc -DLINUX -fPIC -shared -o libtest.so \ -I${COMPILEJAVA}/include -I${COMPILEJAVA}/include/linux \ - ${TESTSRC}/coroutineBreakpointSwitchToTest.c + ${TESTSRC}/testCoroutineBreakpointSwitchTo.c -${JAVA} -agentpath:libtest.so -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.transparentAsync=true -cp ${TESTCLASSES} SimpleWispTest +${JAVA} -agentpath:libtest.so -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.transparentAsync=true -cp ${TESTCLASSES} TestSimpleWisp exit $? diff --git a/test/hotspot/jtreg/runtime/coroutine/jniDetachThreadHoldingMonitorTest.c b/test/hotspot/jtreg/runtime/coroutine/testJniDetachThreadHoldingMonitor.c similarity index 100% rename from test/hotspot/jtreg/runtime/coroutine/jniDetachThreadHoldingMonitorTest.c rename to test/hotspot/jtreg/runtime/coroutine/testJniDetachThreadHoldingMonitor.c diff --git a/test/hotspot/jtreg/runtime/coroutine/testJniDetachThreadHoldingMonitor.sh b/test/hotspot/jtreg/runtime/coroutine/testJniDetachThreadHoldingMonitor.sh new file mode 100644 index 00000000000..296f41ee93a --- /dev/null +++ b/test/hotspot/jtreg/runtime/coroutine/testJniDetachThreadHoldingMonitor.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +## @test +## +## @summary test DetachCurrentThread unpark +## @run shell testJniDetachThreadHoldingMonitor.sh +## + + +export LD_LIBRARY_PATH=.:${COMPILEJAVA}/lib/server:/usr/lib:$LD_LIBRARY_PATH + +g++ -DLINUX -o testJniDetachThreadHoldingMonitor \ + -I${COMPILEJAVA}/include -I${COMPILEJAVA}/include/linux \ + -L${COMPILEJAVA}/lib/server \ + -ljvm -lpthread ${TESTSRC}/testJniDetachThreadHoldingMonitor.c + +./testJniDetachThreadHoldingMonitor +exit $? diff --git a/test/hotspot/jtreg/runtime/coroutine/jniMonitorExitTest.c b/test/hotspot/jtreg/runtime/coroutine/testJniMonitorExit.c similarity index 100% rename from test/hotspot/jtreg/runtime/coroutine/jniMonitorExitTest.c rename to test/hotspot/jtreg/runtime/coroutine/testJniMonitorExit.c diff --git a/test/hotspot/jtreg/runtime/coroutine/testJniMonitorExit.sh b/test/hotspot/jtreg/runtime/coroutine/testJniMonitorExit.sh new file mode 100644 index 00000000000..68df8075900 --- /dev/null +++ b/test/hotspot/jtreg/runtime/coroutine/testJniMonitorExit.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +## @test +## +## @summary test jni MonitorExit +## @run shell testJniMonitorExit.sh +## + + +export LD_LIBRARY_PATH=.:${COMPILEJAVA}/lib/server:/usr/lib:$LD_LIBRARY_PATH +echo ${COMPILEJAVA} +echo $LD_LIBRARY_PATH +g++ -DLINUX -o testJniMonitorExit \ + -I${COMPILEJAVA}/include -I${COMPILEJAVA}/include/linux \ + -L${COMPILEJAVA}/lib/server \ + -ljvm -lpthread ${TESTSRC}/testJniMonitorExit.c + +./testJniMonitorExit +exit $? diff --git a/test/hotspot/jtreg/runtime/coroutine/jvmtiWispMonitorTest.sh b/test/hotspot/jtreg/runtime/coroutine/testJvmtiWispMonitor.sh similarity index 89% rename from test/hotspot/jtreg/runtime/coroutine/jvmtiWispMonitorTest.sh rename to test/hotspot/jtreg/runtime/coroutine/testJvmtiWispMonitor.sh index 26ec971d046..73b75099aba 100644 --- a/test/hotspot/jtreg/runtime/coroutine/jvmtiWispMonitorTest.sh +++ b/test/hotspot/jtreg/runtime/coroutine/testJvmtiWispMonitor.sh @@ -3,7 +3,7 @@ ## @test ## ## @summary test jvmti and wispMonitor could work together -## @run shell jvmtiWispMonitorTest.sh +## @run shell testJvmtiWispMonitor.sh ${TESTJAVA}/bin/java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=localhost:5005 -XX:+EnableCoroutine -XX:+UseWispMonitor & diff --git a/test/hotspot/jtreg/runtime/coroutine/logCompilationTest.sh b/test/hotspot/jtreg/runtime/coroutine/testLogCompilation.sh similarity index 79% rename from test/hotspot/jtreg/runtime/coroutine/logCompilationTest.sh rename to test/hotspot/jtreg/runtime/coroutine/testLogCompilation.sh index 76cc4512aee..586cb82bb2a 100644 --- a/test/hotspot/jtreg/runtime/coroutine/logCompilationTest.sh +++ b/test/hotspot/jtreg/runtime/coroutine/testLogCompilation.sh @@ -3,10 +3,10 @@ # # @test # @library /testlibrary -# @compile SimpleWispTest.java +# @compile TestSimpleWisp.java # # @summary test coroutine and -XX:+LogCompilation could work together -# @run shell logCompilationTest.sh +# @run shell testLogCompilation.sh # OS=`uname -s` @@ -28,6 +28,6 @@ esac JAVA=${TESTJAVA}${FS}bin${FS}java -${JAVA} -XX:+UnlockDiagnosticVMOptions -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.transparentAsync=true -XX:+LogCompilation -Xcomp -cp ${TESTCLASSES} SimpleWispTest +${JAVA} -XX:+UnlockDiagnosticVMOptions -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.transparentAsync=true -XX:+LogCompilation -Xcomp -cp ${TESTCLASSES} TestSimpleWisp -exit $? \ No newline at end of file +exit $? diff --git a/test/hotspot/jtreg/runtime/coroutine/premainWithWispMonitorTest.sh b/test/hotspot/jtreg/runtime/coroutine/testPremainWithWispMonitor.sh similarity index 73% rename from test/hotspot/jtreg/runtime/coroutine/premainWithWispMonitorTest.sh rename to test/hotspot/jtreg/runtime/coroutine/testPremainWithWispMonitor.sh index c05673e1917..59486a290cf 100644 --- a/test/hotspot/jtreg/runtime/coroutine/premainWithWispMonitorTest.sh +++ b/test/hotspot/jtreg/runtime/coroutine/testPremainWithWispMonitor.sh @@ -1,7 +1,7 @@ #!/bin/sh -# see PremainWithWispMonitorTest.java +# see TestPremainWithWispMonitor.java -AGENT=PremainWithWispMonitorTest +AGENT=TestPremainWithWispMonitor if [ "${TESTSRC}" = "" ] then @@ -19,7 +19,7 @@ echo "TESTJAVA=${TESTJAVA}" cp ${TESTSRC}/${AGENT}.java . -${TESTJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} PremainWithWispMonitorTest.java +${TESTJAVA}/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} TestPremainWithWispMonitor.java echo "Manifest-Version: 1.0" > ${AGENT}.mf echo Premain-Class: ${AGENT} >> ${AGENT}.mf @@ -32,5 +32,5 @@ done ${TESTJAVA}/bin/jar ${TESTTOOLVMOPTS} cvfm ${AGENT}.jar ${AGENT}.mf ${AGENT}*.class ${TESTJAVA}/bin/java -XX:+EnableCoroutine -Dcom.alibaba.transparentAsync=true -XX:+UseWispMonitor \ - -javaagent:PremainWithWispMonitorTest.jar PremainWithWispMonitorTest + -javaagent:TestPremainWithWispMonitor.jar TestPremainWithWispMonitor diff --git a/test/jdk/com/alibaba/wisp/ConfigurationCompatibilityCheckTest.java b/test/jdk/com/alibaba/wisp/TestConfigurationCompatibilityCheck.java similarity index 93% rename from test/jdk/com/alibaba/wisp/ConfigurationCompatibilityCheckTest.java rename to test/jdk/com/alibaba/wisp/TestConfigurationCompatibilityCheck.java index 847a26149a2..fff000ef56e 100644 --- a/test/jdk/com/alibaba/wisp/ConfigurationCompatibilityCheckTest.java +++ b/test/jdk/com/alibaba/wisp/TestConfigurationCompatibilityCheck.java @@ -2,14 +2,14 @@ * @test * @summary Test the config compatibility in different wisp version * @library /test/lib - * @run main ConfigurationCompatibilityCheckTest + * @run main TestConfigurationCompatibilityCheck */ import java.util.ArrayList; import java.util.Arrays; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; -public class ConfigurationCompatibilityCheckTest { +public class TestConfigurationCompatibilityCheck { public static void main(String[] args) throws Exception { incompatibility("-Dcom.alibaba.wisp.version=65536"); incompatibility("-Dcom.alibaba.wisp.enableThreadAsWisp=true"); diff --git a/test/jdk/com/alibaba/wisp/CoroutineTest.java b/test/jdk/com/alibaba/wisp/TestCoroutine.java similarity index 93% rename from test/jdk/com/alibaba/wisp/CoroutineTest.java rename to test/jdk/com/alibaba/wisp/TestCoroutine.java index cd3ee800e9d..4431693b7a2 100644 --- a/test/jdk/com/alibaba/wisp/CoroutineTest.java +++ b/test/jdk/com/alibaba/wisp/TestCoroutine.java @@ -1,8 +1,8 @@ /* * @test * @summary Test low level coroutine implement - * @run main/othervm -XX:+EnableCoroutine CoroutineTest - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.version=2 CoroutineTest + * @run main/othervm -XX:+EnableCoroutine TestCoroutine + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.version=2 TestCoroutine */ import java.dyn.Coroutine; @@ -13,7 +13,7 @@ * test low level coroutine implement * 2 coroutine switch to each other and see the sequence */ -public class CoroutineTest { +public class TestCoroutine { static int i = 0; static Coroutine co1, co2; diff --git a/test/jdk/com/alibaba/wisp/ExecutionTest.java b/test/jdk/com/alibaba/wisp/TestExecution.java similarity index 92% rename from test/jdk/com/alibaba/wisp/ExecutionTest.java rename to test/jdk/com/alibaba/wisp/TestExecution.java index 2738f418015..7edc2e96df5 100644 --- a/test/jdk/com/alibaba/wisp/ExecutionTest.java +++ b/test/jdk/com/alibaba/wisp/TestExecution.java @@ -2,8 +2,8 @@ * @test * @summary Test WispEngine's multi-task schedule * @modules java.base/jdk.internal.access - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true ExecutionTest - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 ExecutionTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true TestExecution + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestExecution */ @@ -18,7 +18,7 @@ * test the coroutine execute engine * */ -public class ExecutionTest { +public class TestExecution { static int finishCnt = 0; public static void main(String[] args) { @@ -28,8 +28,8 @@ public static void main(String[] args) { * if ((nodeA() + nodeB()).equals("A:done\nB1:done\nB2:done\n")) * throw new Error("result error"); */ - FutureTask futureA = new FutureTask<>(ExecutionTest::nodeA); - FutureTask futureB = new FutureTask<>(ExecutionTest::nodeB); + FutureTask futureA = new FutureTask<>(TestExecution::nodeA); + FutureTask futureB = new FutureTask<>(TestExecution::nodeB); WispEngine.dispatch(futureA); WispEngine.dispatch(futureB); String result; diff --git a/test/jdk/com/alibaba/wisp/IoTest.java b/test/jdk/com/alibaba/wisp/TestIo.java similarity index 95% rename from test/jdk/com/alibaba/wisp/IoTest.java rename to test/jdk/com/alibaba/wisp/TestIo.java index 1fc58d123d2..27adcc97d49 100644 --- a/test/jdk/com/alibaba/wisp/IoTest.java +++ b/test/jdk/com/alibaba/wisp/TestIo.java @@ -2,8 +2,8 @@ * @test * @summary Test Wisp engine's NIO support * @modules java.base/jdk.internal.access - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true IoTest - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 IoTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true TestIo + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestIo */ @@ -17,7 +17,7 @@ import java.nio.channels.SelectionKey; import java.nio.channels.SocketChannel; -public class IoTest { +public class TestIo { public static void main(String[] args) { String result = http(); diff --git a/test/jdk/com/alibaba/wisp/ParkTest.java b/test/jdk/com/alibaba/wisp/TestPark.java similarity index 94% rename from test/jdk/com/alibaba/wisp/ParkTest.java rename to test/jdk/com/alibaba/wisp/TestPark.java index 8cdc6dc1396..5c3b7037d03 100644 --- a/test/jdk/com/alibaba/wisp/ParkTest.java +++ b/test/jdk/com/alibaba/wisp/TestPark.java @@ -2,8 +2,8 @@ * @test * @summary Test Wisp engine park / unpark * @modules java.base/jdk.internal.access - * @run main/othervm -XX:+EnableCoroutine ParkTest - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.version=2 ParkTest + * @run main/othervm -XX:+EnableCoroutine TestPark + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.version=2 TestPark */ @@ -14,7 +14,7 @@ import java.util.concurrent.TimeUnit; -public class ParkTest { +public class TestPark { public static void main(String[] args) { WispEngineAccess access = SharedSecrets.getWispEngineAccess(); diff --git a/test/jdk/com/alibaba/wisp/SelectorLazyCreateTest.java b/test/jdk/com/alibaba/wisp/TestSelectorLazyCreate.java similarity index 88% rename from test/jdk/com/alibaba/wisp/SelectorLazyCreateTest.java rename to test/jdk/com/alibaba/wisp/TestSelectorLazyCreate.java index 5abd4838fce..17d638d79ba 100644 --- a/test/jdk/com/alibaba/wisp/SelectorLazyCreateTest.java +++ b/test/jdk/com/alibaba/wisp/TestSelectorLazyCreate.java @@ -3,7 +3,7 @@ * @library /test/lib * @summary Test for engine.selector lazy created * @modules java.base/com.alibaba.wisp.engine:+open - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.globalPoller=false SelectorLazyCreateTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.globalPoller=false TestSelectorLazyCreate */ import com.alibaba.wisp.engine.WispEngine; @@ -14,7 +14,7 @@ import static jdk.test.lib.Asserts.assertNotNull; import static jdk.test.lib.Asserts.assertNull; -public class SelectorLazyCreateTest { +public class TestSelectorLazyCreate { public static void main(String[] args) throws Exception { if (!Class.forName("com.alibaba.wisp.engine.ScheduledWispEngine").isInstance(WispEngine.current())) { diff --git a/test/jdk/com/alibaba/wisp/TestWispDetailCounter.java b/test/jdk/com/alibaba/wisp/TestWispDetailCounter.java index 25d4448ce7c..54c45fb5078 100644 --- a/test/jdk/com/alibaba/wisp/TestWispDetailCounter.java +++ b/test/jdk/com/alibaba/wisp/TestWispDetailCounter.java @@ -87,7 +87,6 @@ public static void main(String[] args) throws Exception { es.submit(() -> { try {Thread.sleep(1000);} catch (Exception e){} }); System.out.println(mbean.getNumberOfRunningTasks()); - assertTrue(mbean.getNumberOfRunningTasks().stream().mapToLong(Long::longValue).sum() > 0); // check log file exist File file = new File("wisplog.log"); diff --git a/test/jdk/com/alibaba/wisp/WorkerContainerTest.java b/test/jdk/com/alibaba/wisp/TestWorkerContainer.java similarity index 93% rename from test/jdk/com/alibaba/wisp/WorkerContainerTest.java rename to test/jdk/com/alibaba/wisp/TestWorkerContainer.java index cf31abfc2d3..056b8cdb65e 100644 --- a/test/jdk/com/alibaba/wisp/WorkerContainerTest.java +++ b/test/jdk/com/alibaba/wisp/TestWorkerContainer.java @@ -2,7 +2,7 @@ * @test * @library /test/lib * @summary Test wisp worker thread isn't created without -Dcom.alibaba.wisp.transparentWispSwitch=true - * @run main/othervm -XX:ActiveProcessorCount=2 WorkerContainerTest + * @run main/othervm -XX:ActiveProcessorCount=2 TestWorkerContainer */ import com.alibaba.wisp.engine.WispWorkerContainer; @@ -16,7 +16,7 @@ import static jdk.test.lib.Asserts.assertFalse; -public class WorkerContainerTest { +public class TestWorkerContainer { private static void test() throws Exception { Class.forName(WispWorkerContainer.class.getName()); diff --git a/test/jdk/com/alibaba/wisp/boot/UnsafeDependencyBugTest.java b/test/jdk/com/alibaba/wisp/boot/TestUnsafeDependencyBug.java similarity index 93% rename from test/jdk/com/alibaba/wisp/boot/UnsafeDependencyBugTest.java rename to test/jdk/com/alibaba/wisp/boot/TestUnsafeDependencyBug.java index 222097fcd6b..7859ec41daa 100644 --- a/test/jdk/com/alibaba/wisp/boot/UnsafeDependencyBugTest.java +++ b/test/jdk/com/alibaba/wisp/boot/TestUnsafeDependencyBug.java @@ -2,7 +2,7 @@ * @test * @library /test/lib * @summary test bug fix of SharedSecrets and Unsafe class initializer circular dependency - * @run main UnsafeDependencyBugTest 10 + * @run main TestUnsafeDependencyBug 10 */ @@ -15,7 +15,7 @@ * We need thousand times to reproduce the DEADLOCK. Don't spend too much time here.. * We already add svt test ajdk_svt/wispTest to ensure the DEADLOCK already solved. */ -public class UnsafeDependencyBugTest { +public class TestUnsafeDependencyBug { public static void main(String[] args) throws Exception { long start = System.currentTimeMillis(); diff --git a/test/jdk/com/alibaba/wisp/bug/CancelTimerAndSleepTest.java b/test/jdk/com/alibaba/wisp/bug/TestCancelTimerAndSleep.java similarity index 83% rename from test/jdk/com/alibaba/wisp/bug/CancelTimerAndSleepTest.java rename to test/jdk/com/alibaba/wisp/bug/TestCancelTimerAndSleep.java index 23831fb8b26..94356b6bef1 100644 --- a/test/jdk/com/alibaba/wisp/bug/CancelTimerAndSleepTest.java +++ b/test/jdk/com/alibaba/wisp/bug/TestCancelTimerAndSleep.java @@ -2,8 +2,8 @@ * @test * @summary Test sleep * @modules java.base/jdk.internal.access - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true CancelTimerAndSleepTest - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 CancelTimerAndSleepTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true TestCancelTimerAndSleep + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestCancelTimerAndSleep */ import jdk.internal.access.SharedSecrets; @@ -11,7 +11,7 @@ import java.util.concurrent.TimeUnit; -public class CancelTimerAndSleepTest { +public class TestCancelTimerAndSleep { public static void main(String[] args) throws Exception { WispEngineAccess access = SharedSecrets.getWispEngineAccess(); diff --git a/test/jdk/com/alibaba/wisp/bug/ClearEventTest.java b/test/jdk/com/alibaba/wisp/bug/TestClearEvent.java similarity index 95% rename from test/jdk/com/alibaba/wisp/bug/ClearEventTest.java rename to test/jdk/com/alibaba/wisp/bug/TestClearEvent.java index e771fbc6ccd..a656f1c734d 100644 --- a/test/jdk/com/alibaba/wisp/bug/ClearEventTest.java +++ b/test/jdk/com/alibaba/wisp/bug/TestClearEvent.java @@ -3,8 +3,8 @@ * @summary Explain the fix of T11748781 * @modules java.base/jdk.internal.access * @modules java.base/com.alibaba.wisp.engine:+open - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true ClearEventTest - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 ClearEventTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true TestClearEvent + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestClearEvent */ import com.alibaba.wisp.engine.WispEngine; @@ -20,7 +20,7 @@ import java.nio.channels.SocketChannel; import java.util.concurrent.CountDownLatch; -public class ClearEventTest { +public class TestClearEvent { private static WispEngineAccess access = SharedSecrets.getWispEngineAccess(); private static CountDownLatch threadRun = new CountDownLatch(1); diff --git a/test/jdk/com/alibaba/wisp/bug/Id2TaskMapLeakTest.java b/test/jdk/com/alibaba/wisp/bug/TestId2TaskMapLeak.java similarity index 87% rename from test/jdk/com/alibaba/wisp/bug/Id2TaskMapLeakTest.java rename to test/jdk/com/alibaba/wisp/bug/TestId2TaskMapLeak.java index 6e6638e209e..6ba0ad814cf 100644 --- a/test/jdk/com/alibaba/wisp/bug/Id2TaskMapLeakTest.java +++ b/test/jdk/com/alibaba/wisp/bug/TestId2TaskMapLeak.java @@ -3,8 +3,8 @@ * @library /test/lib * @summary Test for thread WispTask leak * @modules java.base/com.alibaba.wisp.engine:+open - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true Id2TaskMapLeakTest - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 Id2TaskMapLeakTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true TestId2TaskMapLeak + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestId2TaskMapLeak */ import com.alibaba.wisp.engine.WispEngine; import com.alibaba.wisp.engine.WispTask; @@ -15,7 +15,7 @@ import static jdk.test.lib.Asserts.assertEQ; -public class Id2TaskMapLeakTest { +public class TestId2TaskMapLeak { public static void main(String[] args) throws Exception { Field f = WispTask.class.getDeclaredField("id2Task"); f.setAccessible(true); diff --git a/test/jdk/com/alibaba/wisp/bug/ReleaseWispSocketAndExitTest.java b/test/jdk/com/alibaba/wisp/bug/TestReleaseWispSocketAndExit.java similarity index 92% rename from test/jdk/com/alibaba/wisp/bug/ReleaseWispSocketAndExitTest.java rename to test/jdk/com/alibaba/wisp/bug/TestReleaseWispSocketAndExit.java index 33c9f454029..ad791c1d70b 100644 --- a/test/jdk/com/alibaba/wisp/bug/ReleaseWispSocketAndExitTest.java +++ b/test/jdk/com/alibaba/wisp/bug/TestReleaseWispSocketAndExit.java @@ -5,8 +5,8 @@ * 2. task B get the socket S and block on IO. * 3. task A exit and clean S's event, now B waiting forever... * @modules java.base/jdk.internal.access - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=1 ReleaseWispSocketAndExitTest - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 ReleaseWispSocketAndExitTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=1 TestReleaseWispSocketAndExit + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestReleaseWispSocketAndExit */ @@ -19,7 +19,7 @@ import java.net.Socket; import java.util.concurrent.CountDownLatch; -public class ReleaseWispSocketAndExitTest { +public class TestReleaseWispSocketAndExit { static byte buf[] = new byte[1000]; public static void main(String[] args) throws Exception { diff --git a/test/jdk/com/alibaba/wisp/bug/ResetTaskCancelTimerBugTest.java b/test/jdk/com/alibaba/wisp/bug/TestResetTaskCancelTimerBug.java similarity index 93% rename from test/jdk/com/alibaba/wisp/bug/ResetTaskCancelTimerBugTest.java rename to test/jdk/com/alibaba/wisp/bug/TestResetTaskCancelTimerBug.java index 40e6e72e2c6..820c463999d 100644 --- a/test/jdk/com/alibaba/wisp/bug/ResetTaskCancelTimerBugTest.java +++ b/test/jdk/com/alibaba/wisp/bug/TestResetTaskCancelTimerBug.java @@ -2,7 +2,7 @@ * @test * @library /test/lib * @summary test reset task doesn't cancel the current task's timer unexpectedly. - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=1 ResetTaskCancelTimerBugTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=1 TestResetTaskCancelTimerBug */ import com.alibaba.wisp.engine.WispEngine; @@ -15,7 +15,7 @@ import static jdk.test.lib.Asserts.assertTrue; -public class ResetTaskCancelTimerBugTest { +public class TestResetTaskCancelTimerBug { public static void main(String[] args) throws Exception { AtomicReference executor = new AtomicReference<>(); AtomicBoolean submitDone = new AtomicBoolean(); diff --git a/test/jdk/com/alibaba/wisp/bug/TestSelectorInitCritical.java b/test/jdk/com/alibaba/wisp/bug/TestSelectorInitCritical.java new file mode 100644 index 00000000000..6a92c42f286 --- /dev/null +++ b/test/jdk/com/alibaba/wisp/bug/TestSelectorInitCritical.java @@ -0,0 +1,32 @@ +/* + * @test + * @library /test/lib + * @summary Test the fix to NPE issue caused by unexpected co-routine yielding on synchronized(lock) in SelectorProvider.provider() during initialization of WispEngine + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -XX:+UseWispMonitor TestSelectorInitCritical + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -XX:+UseWispMonitor -Dcom.alibaba.wisp.version=2 TestSelectorInitCritical +*/ + + +import java.lang.reflect.Field; +import java.nio.channels.spi.SelectorProvider; +import java.util.concurrent.CountDownLatch; + +public class TestSelectorInitCritical { + public static void main(String[] args) throws Exception { + Field f = SelectorProvider.class.getDeclaredField("lock"); + f.setAccessible(true); + Object selectorProviderLock = f.get(null); + CountDownLatch latch = new CountDownLatch(1); + + Thread t = new Thread(latch::countDown); + + synchronized (selectorProviderLock) { + t.start(); + // Holding selectorProviderLock for a while which will eventually blocks the initialization of t' WispEngine + Thread.sleep(100); + } + + latch.await(); + + } +} diff --git a/test/jdk/com/alibaba/wisp/bug/ThreadLockTest.java b/test/jdk/com/alibaba/wisp/bug/TestThreadLock.java similarity index 90% rename from test/jdk/com/alibaba/wisp/bug/ThreadLockTest.java rename to test/jdk/com/alibaba/wisp/bug/TestThreadLock.java index ca7e56a0f23..a147214058d 100644 --- a/test/jdk/com/alibaba/wisp/bug/ThreadLockTest.java +++ b/test/jdk/com/alibaba/wisp/bug/TestThreadLock.java @@ -2,8 +2,8 @@ * @test * @summary Test fix of WispEngine block on Thread.class lock * @modules java.base/java.lang:+open - * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true ThreadLockTest - * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 ThreadLockTest + * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -XX:+UnlockExperimentalVMOptions -Dcom.alibaba.wisp.transparentWispSwitch=true TestThreadLock + * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -XX:+UnlockExperimentalVMOptions -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestThreadLock */ import com.alibaba.wisp.engine.WispEngine; @@ -12,7 +12,7 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicReference; -public class ThreadLockTest { +public class TestThreadLock { public static void main(String[] args) throws Exception { CountDownLatch done = new CountDownLatch(1); diff --git a/test/jdk/com/alibaba/wisp/bug/ThreadPoolFastShutdownBugTest.java b/test/jdk/com/alibaba/wisp/bug/TestThreadPoolFastShutdownBug.java similarity index 75% rename from test/jdk/com/alibaba/wisp/bug/ThreadPoolFastShutdownBugTest.java rename to test/jdk/com/alibaba/wisp/bug/TestThreadPoolFastShutdownBug.java index 31b9632a712..30f3d647a57 100644 --- a/test/jdk/com/alibaba/wisp/bug/ThreadPoolFastShutdownBugTest.java +++ b/test/jdk/com/alibaba/wisp/bug/TestThreadPoolFastShutdownBug.java @@ -1,15 +1,15 @@ /* * @test * @summary test shutdown a thread pool which contains non-fully-started thread - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=1 ThreadPoolFastShutdownBugTest - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 ThreadPoolFastShutdownBugTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=1 TestThreadPoolFastShutdownBug + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestThreadPoolFastShutdownBug */ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -public class ThreadPoolFastShutdownBugTest { +public class TestThreadPoolFastShutdownBug { public static void main(String[] args) { ExecutorService executorService = Executors.newSingleThreadExecutor(); executorService.submit(new InitThread()); diff --git a/test/jdk/com/alibaba/wisp/bug/WispEngineCriticalSectionTest.java b/test/jdk/com/alibaba/wisp/bug/TestWispEngineCriticalSection.java similarity index 96% rename from test/jdk/com/alibaba/wisp/bug/WispEngineCriticalSectionTest.java rename to test/jdk/com/alibaba/wisp/bug/TestWispEngineCriticalSection.java index 68c62fb2eb1..54c83af1b48 100644 --- a/test/jdk/com/alibaba/wisp/bug/WispEngineCriticalSectionTest.java +++ b/test/jdk/com/alibaba/wisp/bug/TestWispEngineCriticalSection.java @@ -4,7 +4,7 @@ * @modules java.base/jdk.internal.access * @modules java.base/com.alibaba.wisp.engine:+open * @modules java.base/java.nio.channels.spi:+open - * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.globalPoller=false WispEngineCriticalSectionTest + * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.globalPoller=false TestWispEngineCriticalSection */ @@ -18,7 +18,7 @@ import java.util.Set; import java.util.concurrent.CountDownLatch; -public class WispEngineCriticalSectionTest { +public class TestWispEngineCriticalSection { public static void main(String[] args) throws Exception { // do blocking operation and register to engine Socket so = new Socket("www.example.com", 80); diff --git a/test/jdk/com/alibaba/wisp/bug/WispSelectorReadyOpsTest.java b/test/jdk/com/alibaba/wisp/bug/TestWispSelectorReadyOps.java similarity index 89% rename from test/jdk/com/alibaba/wisp/bug/WispSelectorReadyOpsTest.java rename to test/jdk/com/alibaba/wisp/bug/TestWispSelectorReadyOps.java index 657ba2a42c2..81d7e2efdd4 100644 --- a/test/jdk/com/alibaba/wisp/bug/WispSelectorReadyOpsTest.java +++ b/test/jdk/com/alibaba/wisp/bug/TestWispSelectorReadyOps.java @@ -1,8 +1,8 @@ /* * @test * @summary ensure nio program call SelectionKey.is{}able() and got correct result. - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true WispSelectorReadyOpsTest - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 WispSelectorReadyOpsTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true TestWispSelectorReadyOps + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestWispSelectorReadyOps */ import java.net.InetSocketAddress; @@ -12,7 +12,7 @@ import java.nio.channels.ServerSocketChannel; import java.nio.channels.SocketChannel; -public class WispSelectorReadyOpsTest { +public class TestWispSelectorReadyOps { public static void main(String[] args) throws Exception { Selector selector = Selector.open(); ServerSocketChannel sch = ServerSocketChannel.open(); diff --git a/test/jdk/com/alibaba/wisp/bug/WispSocketLeakWhenConnectTimeoutTest.java b/test/jdk/com/alibaba/wisp/bug/TestWispSocketLeakWhenConnectTimeout.java similarity index 84% rename from test/jdk/com/alibaba/wisp/bug/WispSocketLeakWhenConnectTimeoutTest.java rename to test/jdk/com/alibaba/wisp/bug/TestWispSocketLeakWhenConnectTimeout.java index 7af3919a6c0..0e173050ad2 100644 --- a/test/jdk/com/alibaba/wisp/bug/WispSocketLeakWhenConnectTimeoutTest.java +++ b/test/jdk/com/alibaba/wisp/bug/TestWispSocketLeakWhenConnectTimeout.java @@ -2,7 +2,7 @@ * @test * @library /test/lib * @summary test the fix to fd leakage when socket connect timeout - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 WispSocketLeakWhenConnectTimeoutTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestWispSocketLeakWhenConnectTimeout */ import java.io.IOException; @@ -12,7 +12,7 @@ import static jdk.test.lib.Asserts.assertTrue; -public class WispSocketLeakWhenConnectTimeoutTest { +public class TestWispSocketLeakWhenConnectTimeout { public static void main(String[] args) throws IOException { Socket so = new Socket(); boolean timeout = false; diff --git a/test/jdk/com/alibaba/wisp/close/WispDestroyTest.java b/test/jdk/com/alibaba/wisp/close/TestWispDestroy.java similarity index 87% rename from test/jdk/com/alibaba/wisp/close/WispDestroyTest.java rename to test/jdk/com/alibaba/wisp/close/TestWispDestroy.java index 0ac1dc81a78..ff9f82b7b71 100644 --- a/test/jdk/com/alibaba/wisp/close/WispDestroyTest.java +++ b/test/jdk/com/alibaba/wisp/close/TestWispDestroy.java @@ -2,8 +2,8 @@ * @test * @summary Test WispEngine's destroy * @modules java.base/com.alibaba.wisp.engine:+open - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true WispDestroyTest - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 WispDestroyTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true TestWispDestroy + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestWispDestroy */ import com.alibaba.wisp.engine.WispEngine; @@ -14,7 +14,7 @@ import java.util.concurrent.TimeUnit; import java.nio.channels.ClosedSelectorException; -public class WispDestroyTest { +public class TestWispDestroy { static WispEngine e; diff --git a/test/jdk/com/alibaba/wisp/env/CtxClassLoaderIsolateTest.java b/test/jdk/com/alibaba/wisp/env/TestCtxClassLoaderIsolate.java similarity index 83% rename from test/jdk/com/alibaba/wisp/env/CtxClassLoaderIsolateTest.java rename to test/jdk/com/alibaba/wisp/env/TestCtxClassLoaderIsolate.java index a4df7176f2c..dd1cefe1925 100644 --- a/test/jdk/com/alibaba/wisp/env/CtxClassLoaderIsolateTest.java +++ b/test/jdk/com/alibaba/wisp/env/TestCtxClassLoaderIsolate.java @@ -2,8 +2,8 @@ * @test * @library /test/lib * @summary Verify the context class loader isolation per co-routine - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true CtxClassLoaderIsolateTest - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 CtxClassLoaderIsolateTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true TestCtxClassLoaderIsolate + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestCtxClassLoaderIsolate */ @@ -11,7 +11,7 @@ import static jdk.test.lib.Asserts.assertTrue; -public class CtxClassLoaderIsolateTest { +public class TestCtxClassLoaderIsolate { public static void main(String[] args) throws Exception { ClassLoader loader0 = Thread.currentThread().getContextClassLoader(); WispEngine.dispatch(() -> Thread.currentThread().setContextClassLoader(new ClassLoader() { diff --git a/test/jdk/com/alibaba/wisp/io/BlockingAccept2Test.java b/test/jdk/com/alibaba/wisp/io/TestBlockingAccept2.java similarity index 95% rename from test/jdk/com/alibaba/wisp/io/BlockingAccept2Test.java rename to test/jdk/com/alibaba/wisp/io/TestBlockingAccept2.java index e441ff3036a..896cf3e24e2 100644 --- a/test/jdk/com/alibaba/wisp/io/BlockingAccept2Test.java +++ b/test/jdk/com/alibaba/wisp/io/TestBlockingAccept2.java @@ -2,7 +2,7 @@ * @test * @library /test/lib * @summary test blocking accept - * @run main/othervm -Dcom.alibaba.wisp.carrierEngines=1 -XX:+UseWisp2 BlockingAccept2Test + * @run main/othervm -Dcom.alibaba.wisp.carrierEngines=1 -XX:+UseWisp2 TestBlockingAccept2 */ import com.alibaba.wisp.engine.WispEngine; @@ -15,7 +15,7 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -public class BlockingAccept2Test { +public class TestBlockingAccept2 { public static void main(String[] args) throws Exception { CountDownLatch latch = new CountDownLatch(1); CountDownLatch latch2 = new CountDownLatch(1); diff --git a/test/jdk/com/alibaba/wisp/io/CreateFdOnDemandTest.java b/test/jdk/com/alibaba/wisp/io/TestCreateFdOnDemand.java similarity index 91% rename from test/jdk/com/alibaba/wisp/io/CreateFdOnDemandTest.java rename to test/jdk/com/alibaba/wisp/io/TestCreateFdOnDemand.java index 389cdd45797..222c4e90a03 100644 --- a/test/jdk/com/alibaba/wisp/io/CreateFdOnDemandTest.java +++ b/test/jdk/com/alibaba/wisp/io/TestCreateFdOnDemand.java @@ -2,8 +2,8 @@ * @test * @library /test/lib * @summary Test fix of unconnected Socket fd leak. - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true CreateFdOnDemandTest - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 CreateFdOnDemandTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true TestCreateFdOnDemand + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestCreateFdOnDemand */ import java.io.File; @@ -16,7 +16,7 @@ import static jdk.test.lib.Asserts.assertEQ; import static jdk.test.lib.Asserts.assertTrue; -public class CreateFdOnDemandTest { +public class TestCreateFdOnDemand { public static void main(String[] args) throws Exception { assertEQ(countFd(), countFd()); diff --git a/test/jdk/com/alibaba/wisp/io/DatagramSocketTest.java b/test/jdk/com/alibaba/wisp/io/TestDatagramSocket.java similarity index 93% rename from test/jdk/com/alibaba/wisp/io/DatagramSocketTest.java rename to test/jdk/com/alibaba/wisp/io/TestDatagramSocket.java index 886d389de93..de8220d492c 100644 --- a/test/jdk/com/alibaba/wisp/io/DatagramSocketTest.java +++ b/test/jdk/com/alibaba/wisp/io/TestDatagramSocket.java @@ -3,8 +3,8 @@ * @library /test/lib * @summary Test WispEngine's DatagramSocket, InitialDirContext use dup socket to query dns. * @modules java.base/jdk.internal.access - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true DatagramSocketTest - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 DatagramSocketTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true TestDatagramSocket + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestDatagramSocket */ @@ -17,10 +17,10 @@ import java.util.concurrent.CountDownLatch; import static jdk.test.lib.Asserts.*; -public class DatagramSocketTest { +public class TestDatagramSocket { public static void main(String[] args) throws Exception { for (int i = 0; i < 10; i++) { - WispEngine.dispatch(DatagramSocketTest::foo); + WispEngine.dispatch(TestDatagramSocket::foo); } SharedSecrets.getWispEngineAccess().eventLoop(); diff --git a/test/jdk/com/alibaba/wisp/io/GlobalPollerTest.java b/test/jdk/com/alibaba/wisp/io/TestGlobalPoller.java similarity index 96% rename from test/jdk/com/alibaba/wisp/io/GlobalPollerTest.java rename to test/jdk/com/alibaba/wisp/io/TestGlobalPoller.java index 9b6559b949d..ab960c6a09a 100644 --- a/test/jdk/com/alibaba/wisp/io/GlobalPollerTest.java +++ b/test/jdk/com/alibaba/wisp/io/TestGlobalPoller.java @@ -5,7 +5,7 @@ * @modules java.base/jdk.internal.access * @modules java.base/sun.nio.ch * @modules java.base/com.alibaba.wisp.engine:+open - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.transparentAsync=true GlobalPollerTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.transparentAsync=true TestGlobalPoller */ import com.alibaba.wisp.engine.WispEngine; @@ -21,7 +21,7 @@ import static jdk.test.lib.Asserts.assertTrue; -public class GlobalPollerTest { +public class TestGlobalPoller { private static WispEngineAccess access = SharedSecrets.getWispEngineAccess(); public static void main(String[] args) throws Exception { @@ -50,4 +50,4 @@ public static void main(String[] args) throws Exception { so.close(); } -} \ No newline at end of file +} diff --git a/test/jdk/com/alibaba/wisp/io/ReuseUdpSocektBufTest.java b/test/jdk/com/alibaba/wisp/io/TestReuseUdpSocektBuf.java similarity index 95% rename from test/jdk/com/alibaba/wisp/io/ReuseUdpSocektBufTest.java rename to test/jdk/com/alibaba/wisp/io/TestReuseUdpSocektBuf.java index 0f46625e1d8..9c7e1d35cfa 100644 --- a/test/jdk/com/alibaba/wisp/io/ReuseUdpSocektBufTest.java +++ b/test/jdk/com/alibaba/wisp/io/TestReuseUdpSocektBuf.java @@ -2,7 +2,7 @@ * @test * @library /test/lib * @summary test reuse WispUdpSocket buffer - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true ReuseUdpSocektBufTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true TestReuseUdpSocektBuf */ import java.net.DatagramPacket; @@ -12,7 +12,7 @@ import static jdk.test.lib.Asserts.assertTrue; -public class ReuseUdpSocektBufTest { +public class TestReuseUdpSocektBuf { static String msgs[] = {"Hello World", "Java", "Good Bye"}; static int port; diff --git a/test/jdk/com/alibaba/wisp/io/SelectorRebuildTest.java b/test/jdk/com/alibaba/wisp/io/TestSelectorRebuild.java similarity index 96% rename from test/jdk/com/alibaba/wisp/io/SelectorRebuildTest.java rename to test/jdk/com/alibaba/wisp/io/TestSelectorRebuild.java index 435a9ac1d2b..6d3930d4dfd 100644 --- a/test/jdk/com/alibaba/wisp/io/SelectorRebuildTest.java +++ b/test/jdk/com/alibaba/wisp/io/TestSelectorRebuild.java @@ -7,10 +7,10 @@ /* @test * @summary Selector rebuild test - * @run main/othervm -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.transparentAsync=true -Dcom.alibaba.shiftThreadModel=true -Dcom.alibaba.globalPoller=false SelectorRebuildTest + * @run main/othervm -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.transparentAsync=true -Dcom.alibaba.shiftThreadModel=true -Dcom.alibaba.globalPoller=false TestSelectorRebuild */ -public class SelectorRebuildTest { +public class TestSelectorRebuild { public static void main(String[] args) throws Exception { diff --git a/test/jdk/com/alibaba/wisp/io/ShareFdTest.java b/test/jdk/com/alibaba/wisp/io/TestShareFd.java similarity index 88% rename from test/jdk/com/alibaba/wisp/io/ShareFdTest.java rename to test/jdk/com/alibaba/wisp/io/TestShareFd.java index d989f40a07d..eead72e0526 100644 --- a/test/jdk/com/alibaba/wisp/io/ShareFdTest.java +++ b/test/jdk/com/alibaba/wisp/io/TestShareFd.java @@ -2,8 +2,8 @@ * @test * @library /test/lib * @summary test support fd use acorss coroutines - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=1 ShareFdTest - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 ShareFdTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=1 TestShareFd + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestShareFd */ import java.net.InetSocketAddress; @@ -13,12 +13,12 @@ import static jdk.test.lib.Asserts.assertTrue; -public class ShareFdTest { +public class TestShareFd { private static boolean success = true; private static ServerSocket serverSocket = null; public static void main(String[] args) { - ShareFdTest shareFdTest = new ShareFdTest(); + TestShareFd shareFdTest = new TestShareFd(); shareFdTest.testAccept(); assert success; } diff --git a/test/jdk/com/alibaba/wisp/io/SocketTest.java b/test/jdk/com/alibaba/wisp/io/TestSocket.java similarity index 96% rename from test/jdk/com/alibaba/wisp/io/SocketTest.java rename to test/jdk/com/alibaba/wisp/io/TestSocket.java index 0eda1a2ae65..ef636e0ada4 100644 --- a/test/jdk/com/alibaba/wisp/io/SocketTest.java +++ b/test/jdk/com/alibaba/wisp/io/TestSocket.java @@ -1,7 +1,7 @@ /* * @test * @summary Test WispEngine's Socket - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 SocketTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestSocket */ import java.io.IOException; @@ -13,7 +13,7 @@ import java.util.Arrays; import java.util.List; -public class SocketTest { +public class TestSocket { public static void main(String[] args) throws IOException { System.out.println(mkSocketPair()); // test accept() and connect() diff --git a/test/jdk/com/alibaba/wisp/io/WispSocketCloseTest.java b/test/jdk/com/alibaba/wisp/io/TestWispSocketClose.java similarity index 85% rename from test/jdk/com/alibaba/wisp/io/WispSocketCloseTest.java rename to test/jdk/com/alibaba/wisp/io/TestWispSocketClose.java index 528878277bb..996e7631549 100644 --- a/test/jdk/com/alibaba/wisp/io/WispSocketCloseTest.java +++ b/test/jdk/com/alibaba/wisp/io/TestWispSocketClose.java @@ -2,9 +2,9 @@ * @test * @library /test/lib * @summary test close will wake up blocking wispTask - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=1 WispSocketCloseTest - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=1 -Dcom.alibaba.globalPoller=false WispSocketCloseTest - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 WispSocketCloseTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=1 TestWispSocketClose + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=1 -Dcom.alibaba.globalPoller=false TestWispSocketClose + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestWispSocketClose */ import java.io.IOException; @@ -15,7 +15,7 @@ import static jdk.test.lib.Asserts.assertTrue; -public class WispSocketCloseTest { +public class TestWispSocketClose { class Reaper extends Thread { Socket s; @@ -35,7 +35,7 @@ public void run() { } } - WispSocketCloseTest() throws Exception { + TestWispSocketClose() throws Exception { ServerSocket ss = new ServerSocket(0); ss.setSoTimeout(1000); @@ -70,6 +70,6 @@ public void run() { } public static void main(String args[]) throws Exception { - new WispSocketCloseTest(); + new TestWispSocketClose(); } } diff --git a/test/jdk/com/alibaba/wisp/lock/AQSTest.java b/test/jdk/com/alibaba/wisp/lock/TestAQS.java similarity index 93% rename from test/jdk/com/alibaba/wisp/lock/AQSTest.java rename to test/jdk/com/alibaba/wisp/lock/TestAQS.java index 5d4d6a6bf4c..ee26e420037 100644 --- a/test/jdk/com/alibaba/wisp/lock/AQSTest.java +++ b/test/jdk/com/alibaba/wisp/lock/TestAQS.java @@ -2,8 +2,8 @@ * @test * @summary Test AQS: CountDownLatch is implement by AQS * @modules java.base/jdk.internal.access - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true AQSTest - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 AQSTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true TestAQS + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestAQS */ @@ -13,7 +13,7 @@ import java.util.concurrent.CountDownLatch; -public class AQSTest { +public class TestAQS { static CountDownLatch cd = new CountDownLatch(1); static CountDownLatch cd2 = new CountDownLatch(1); public static void main(String[] args) { diff --git a/test/jdk/com/alibaba/wisp/lock/ElisionSpinTest.java b/test/jdk/com/alibaba/wisp/lock/TestElisionSpin.java similarity index 90% rename from test/jdk/com/alibaba/wisp/lock/ElisionSpinTest.java rename to test/jdk/com/alibaba/wisp/lock/TestElisionSpin.java index e56e02072da..dd3a72a7014 100644 --- a/test/jdk/com/alibaba/wisp/lock/ElisionSpinTest.java +++ b/test/jdk/com/alibaba/wisp/lock/TestElisionSpin.java @@ -3,7 +3,7 @@ * @summary Test elision spin * @modules java.base/jdk.internal.access * @library /test/lib - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.useStealLock=false ElisionSpinTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.useStealLock=false TestElisionSpin */ import com.alibaba.wisp.engine.WispEngine; @@ -15,7 +15,7 @@ import static jdk.test.lib.Asserts.assertFalse; import static jdk.test.lib.Asserts.assertTrue; -public class ElisionSpinTest { +public class TestElisionSpin { public static void main(String[] args) { assertFalse(SharedSecrets.getWispEngineAccess().hasMoreTasks()); diff --git a/test/jdk/com/alibaba/wisp/lock/LockTest.java b/test/jdk/com/alibaba/wisp/lock/TestLock.java similarity index 86% rename from test/jdk/com/alibaba/wisp/lock/LockTest.java rename to test/jdk/com/alibaba/wisp/lock/TestLock.java index f153085bfa5..c8ad8a2b971 100644 --- a/test/jdk/com/alibaba/wisp/lock/LockTest.java +++ b/test/jdk/com/alibaba/wisp/lock/TestLock.java @@ -2,7 +2,7 @@ * @test * @summary Test ReentrantLock in coroutine environment * @modules java.base/jdk.internal.access - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 LockTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestLock */ @@ -14,21 +14,21 @@ import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; -public class LockTest { +public class TestLock { static Lock lock = new ReentrantLock(); static Condition cond = lock.newCondition(); public static void main(String[] args) { - WispEngine.dispatch(LockTest::p1); - WispEngine.dispatch(LockTest::p2); + WispEngine.dispatch(TestLock::p1); + WispEngine.dispatch(TestLock::p2); SharedSecrets.getWispEngineAccess().eventLoop(); System.out.println(lock); - new Thread(LockTest::p1).start(); + new Thread(TestLock::p1).start(); SharedSecrets.getWispEngineAccess().sleep(1); - new Thread(LockTest::p2).start(); + new Thread(TestLock::p2).start(); } public static void assertInterval(long start, int diff, int bias) { diff --git a/test/jdk/com/alibaba/wisp/lock/LockUninterruptiblyTest.java b/test/jdk/com/alibaba/wisp/lock/TestLockUninterruptibly.java similarity index 92% rename from test/jdk/com/alibaba/wisp/lock/LockUninterruptiblyTest.java rename to test/jdk/com/alibaba/wisp/lock/TestLockUninterruptibly.java index 58cffa63ac4..cd52dc4d723 100644 --- a/test/jdk/com/alibaba/wisp/lock/LockUninterruptiblyTest.java +++ b/test/jdk/com/alibaba/wisp/lock/TestLockUninterruptibly.java @@ -3,8 +3,8 @@ * @library /test/lib * @summary Test to verify we are not spinning when we're trying to acquire monitor with interrupted status * @modules java.base/com.alibaba.wisp.engine:+open - * @run main/othervm -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true LockUninterruptiblyTest - * @run main/othervm -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 LockUninterruptiblyTest + * @run main/othervm -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true TestLockUninterruptibly + * @run main/othervm -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestLockUninterruptibly */ import com.alibaba.wisp.engine.WispEngine; @@ -14,7 +14,7 @@ import static jdk.test.lib.Asserts.assertTrue; -public class LockUninterruptiblyTest { +public class TestLockUninterruptibly { public static void main(String[] args) throws Exception { Object lock = new Object(); diff --git a/test/jdk/com/alibaba/wisp/lock/ParkNanoTest.java b/test/jdk/com/alibaba/wisp/lock/TestParkNano.java similarity index 84% rename from test/jdk/com/alibaba/wisp/lock/ParkNanoTest.java rename to test/jdk/com/alibaba/wisp/lock/TestParkNano.java index b24f33e491d..1a8d8deffc1 100644 --- a/test/jdk/com/alibaba/wisp/lock/ParkNanoTest.java +++ b/test/jdk/com/alibaba/wisp/lock/TestParkNano.java @@ -1,15 +1,15 @@ /* * @test * @summary Test park nanos - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true ParkNanoTest - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 ParkNanoTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true TestParkNano + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestParkNano */ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -public class ParkNanoTest { +public class TestParkNano { public static void main(String[] args) throws Exception { doTest(400_000, 300_000); doTest(800_000, 500_000); diff --git a/test/jdk/com/alibaba/wisp/lock/UnsafeParkTest.java b/test/jdk/com/alibaba/wisp/lock/TestUnsafePark.java similarity index 90% rename from test/jdk/com/alibaba/wisp/lock/UnsafeParkTest.java rename to test/jdk/com/alibaba/wisp/lock/TestUnsafePark.java index 3945df55e5a..a30e456bcce 100644 --- a/test/jdk/com/alibaba/wisp/lock/UnsafeParkTest.java +++ b/test/jdk/com/alibaba/wisp/lock/TestUnsafePark.java @@ -2,8 +2,8 @@ * @test * @library /test/lib * @summary Test to verify we can do proper wisp scheduling while calling on Unsafe.park() - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true UnsafeParkTest - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 UnsafeParkTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true TestUnsafePark + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestUnsafePark */ import com.alibaba.wisp.engine.WispEngine; @@ -16,7 +16,7 @@ import static jdk.test.lib.Asserts.assertTrue; -public class UnsafeParkTest { +public class TestUnsafePark { public static void main(String[] args) throws Exception { Field f = Unsafe.class.getDeclaredField("theUnsafe"); f.setAccessible(true); diff --git a/test/jdk/com/alibaba/wisp/monitor/C2SyncMethodTest.java b/test/jdk/com/alibaba/wisp/monitor/TestC2SyncMethod.java similarity index 85% rename from test/jdk/com/alibaba/wisp/monitor/C2SyncMethodTest.java rename to test/jdk/com/alibaba/wisp/monitor/TestC2SyncMethod.java index 7b6c9ec8756..4b3560871b6 100644 --- a/test/jdk/com/alibaba/wisp/monitor/C2SyncMethodTest.java +++ b/test/jdk/com/alibaba/wisp/monitor/TestC2SyncMethod.java @@ -1,10 +1,10 @@ /* * @test * @summary test to run a compiled/synchronized method with wisp enabled. - * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true C2SyncMethodTest - * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 C2SyncMethodTest + * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true TestC2SyncMethod + * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestC2SyncMethod */ -public class C2SyncMethodTest { +public class TestC2SyncMethod { public synchronized static void main(String[] args) { for (int i = 0; i < 1000000; i++) { foo(); diff --git a/test/jdk/com/alibaba/wisp/monitor/FinalizerTest.java b/test/jdk/com/alibaba/wisp/monitor/TestFinalizer.java similarity index 91% rename from test/jdk/com/alibaba/wisp/monitor/FinalizerTest.java rename to test/jdk/com/alibaba/wisp/monitor/TestFinalizer.java index 0875993483c..daf32d4a531 100644 --- a/test/jdk/com/alibaba/wisp/monitor/FinalizerTest.java +++ b/test/jdk/com/alibaba/wisp/monitor/TestFinalizer.java @@ -1,11 +1,11 @@ /* * @test * @summary Test unpark in a finalizer thread. - * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true FinalizerTest - * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 FinalizerTest + * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true TestFinalizer + * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestFinalizer */ -public class FinalizerTest { +public class TestFinalizer { static final Foo lock = new Foo(); public static void main(String[] args) throws Exception { new Foo(); diff --git a/test/jdk/com/alibaba/wisp/monitor/JNICriticalTest.java b/test/jdk/com/alibaba/wisp/monitor/TestJNICritical.java similarity index 92% rename from test/jdk/com/alibaba/wisp/monitor/JNICriticalTest.java rename to test/jdk/com/alibaba/wisp/monitor/TestJNICritical.java index da033e43829..9948aea9cc8 100644 --- a/test/jdk/com/alibaba/wisp/monitor/JNICriticalTest.java +++ b/test/jdk/com/alibaba/wisp/monitor/TestJNICritical.java @@ -2,7 +2,7 @@ * @test * @summary Test unpark in JNI critical case * @modules java.base/jdk.internal.access - * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 JNICriticalTest + * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestJNICritical */ @@ -17,13 +17,13 @@ import java.util.stream.IntStream; import java.util.zip.Deflater; -public class JNICriticalTest { +public class TestJNICritical { public static void main(String[] args) throws Exception { CountDownLatch latch = new CountDownLatch(16); AtomicInteger id = new AtomicInteger(); ExecutorService es = Executors.newCachedThreadPool(r -> { Thread t = new Thread(r); - t.setName("JNICriticalTest" + id.getAndIncrement()); + t.setName("TestJNICritical" + id.getAndIncrement()); return t; }); IntStream.range(0, 4).forEach(ign -> es.execute(() -> { diff --git a/test/jdk/com/alibaba/wisp/monitor/LazyUnparkBugTest.java b/test/jdk/com/alibaba/wisp/monitor/TestLazyUnparkBug.java similarity index 85% rename from test/jdk/com/alibaba/wisp/monitor/LazyUnparkBugTest.java rename to test/jdk/com/alibaba/wisp/monitor/TestLazyUnparkBug.java index 008408cf8df..d976a9a82c6 100644 --- a/test/jdk/com/alibaba/wisp/monitor/LazyUnparkBugTest.java +++ b/test/jdk/com/alibaba/wisp/monitor/TestLazyUnparkBug.java @@ -2,18 +2,18 @@ * @test * @summary T12212948 * @library /test/lib - * @run main/othervm -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true LazyUnparkBugTest - * @run main/othervm -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 LazyUnparkBugTest + * @run main/othervm -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true TestLazyUnparkBug + * @run main/othervm -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestLazyUnparkBug */ -public class LazyUnparkBugTest { +public class TestLazyUnparkBug { private static volatile Object thunk = null; public static void test() throws Exception { thunk = null; Thread t1 = new Thread(() -> { try { - synchronized (LazyUnparkBugTest.class) { + synchronized (TestLazyUnparkBug.class) { Thread.sleep(1_000L); } Object o; @@ -28,7 +28,7 @@ public static void test() throws Exception { Thread t2 = new Thread(() -> { try { Thread.sleep(5_0L); - synchronized (LazyUnparkBugTest.class) { + synchronized (TestLazyUnparkBug.class) { System.out.println("in t2"); } } catch (Exception e) { diff --git a/test/jdk/com/alibaba/wisp/monitor/MultiThreadTest.java b/test/jdk/com/alibaba/wisp/monitor/TestMultiThread.java similarity index 98% rename from test/jdk/com/alibaba/wisp/monitor/MultiThreadTest.java rename to test/jdk/com/alibaba/wisp/monitor/TestMultiThread.java index 851268e1cb7..13b82bc7515 100644 --- a/test/jdk/com/alibaba/wisp/monitor/MultiThreadTest.java +++ b/test/jdk/com/alibaba/wisp/monitor/TestMultiThread.java @@ -3,7 +3,7 @@ * @library /test/lib * @summary Test object lock with coroutine * @modules java.base/jdk.internal.access - * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 MultiThreadTest + * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestMultiThread */ @@ -19,7 +19,7 @@ import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; -public class MultiThreadTest { +public class TestMultiThread { final static Runner[] runners = new Runner[8]; static boolean JUC; static final int N = 40000; diff --git a/test/jdk/com/alibaba/wisp/monitor/SynchronizedTest.java b/test/jdk/com/alibaba/wisp/monitor/TestSynchronized.java similarity index 82% rename from test/jdk/com/alibaba/wisp/monitor/SynchronizedTest.java rename to test/jdk/com/alibaba/wisp/monitor/TestSynchronized.java index f34a4faaa80..c0a7c8e9bfd 100644 --- a/test/jdk/com/alibaba/wisp/monitor/SynchronizedTest.java +++ b/test/jdk/com/alibaba/wisp/monitor/TestSynchronized.java @@ -1,16 +1,16 @@ /* * @test * @summary Basic test for java primitive lock(synchronized) - * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true SynchronizedTest - * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 SynchronizedTest + * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true TestSynchronized + * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestSynchronized */ import com.alibaba.wisp.engine.WispEngine; -public class SynchronizedTest { +public class TestSynchronized { public static void main(String[] args) { - SynchronizedTest s = new SynchronizedTest(); + TestSynchronized s = new TestSynchronized(); WispEngine.dispatch(s::foo); WispEngine.dispatch(s::bar); } diff --git a/test/jdk/com/alibaba/wisp/monitor/WaitNotifyTest.java b/test/jdk/com/alibaba/wisp/monitor/TestWaitNotify.java similarity index 94% rename from test/jdk/com/alibaba/wisp/monitor/WaitNotifyTest.java rename to test/jdk/com/alibaba/wisp/monitor/TestWaitNotify.java index 668f76441ac..fe0a2df408a 100644 --- a/test/jdk/com/alibaba/wisp/monitor/WaitNotifyTest.java +++ b/test/jdk/com/alibaba/wisp/monitor/TestWaitNotify.java @@ -2,7 +2,7 @@ * @test * @library /test/lib * @summary Test Object.wait/notify with coroutine - * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true WaitNotifyTest + * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true TestWaitNotify */ import com.alibaba.wisp.engine.WispEngine; @@ -11,10 +11,10 @@ import static jdk.test.lib.Asserts.assertEQ; -public class WaitNotifyTest { +public class TestWaitNotify { public static void main(String[] args) throws Exception { for (int i = 0; i < 1; i++) { - WaitNotifyTest s = new WaitNotifyTest(); + TestWaitNotify s = new TestWaitNotify(); assertEQ(s.count++, 0); WispEngine.dispatch(s::foo); WispEngine.dispatch(s::bar); diff --git a/test/jdk/com/alibaba/wisp/monitor/WispExitTest.java b/test/jdk/com/alibaba/wisp/monitor/TestWispExit.java similarity index 82% rename from test/jdk/com/alibaba/wisp/monitor/WispExitTest.java rename to test/jdk/com/alibaba/wisp/monitor/TestWispExit.java index 2c6ea9d1cd3..676d03ba94d 100644 --- a/test/jdk/com/alibaba/wisp/monitor/WispExitTest.java +++ b/test/jdk/com/alibaba/wisp/monitor/TestWispExit.java @@ -1,10 +1,10 @@ /* * @test * @summary Ensure we can exit vm when -XX:+UseWispMonitor - * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true WispExitTest - * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 WispExitTest + * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true TestWispExit + * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestWispExit */ -public class WispExitTest { +public class TestWispExit { public static void main(String[] args) throws Exception { } diff --git a/test/jdk/com/alibaba/wisp/thread/DaemonTest.java b/test/jdk/com/alibaba/wisp/thread/TestDaemon.java similarity index 94% rename from test/jdk/com/alibaba/wisp/thread/DaemonTest.java rename to test/jdk/com/alibaba/wisp/thread/TestDaemon.java index 0dd0335c415..7624b896c12 100644 --- a/test/jdk/com/alibaba/wisp/thread/DaemonTest.java +++ b/test/jdk/com/alibaba/wisp/thread/TestDaemon.java @@ -3,7 +3,7 @@ * @library /test/lib * @summary test thread as wisp still keep the daemon semantic * - * @run main DaemonTest + * @run main TestDaemon */ import static jdk.test.lib.Asserts.assertEQ; @@ -11,7 +11,7 @@ import jdk.test.lib.process.ProcessTools; -public class DaemonTest { +public class TestDaemon { private static final String SHUTDOWN_MSG = "[Run ShutdownHook]"; @@ -48,7 +48,7 @@ public static void main(String[] args) throws Exception { private static void driver(boolean daemon) throws Exception { // we can not use jdk.testlibrary.ProcessTools here, because we need to analyse stdout of a unfinished process Process process = new ProcessBuilder(System.getProperty("java.home") + "/bin/java", - "-XX:+UseWisp2", "-cp", System.getProperty("java.class.path"), DaemonTest.class.getName(), Boolean.toString(daemon)).start(); + "-XX:+UseWisp2", "-cp", System.getProperty("java.class.path"), TestDaemon.class.getName(), Boolean.toString(daemon)).start(); Thread.sleep(2000); byte[] buffer = new byte[1024]; int n = process.getInputStream().read(buffer); diff --git a/test/jdk/com/alibaba/wisp/thread/DisableThreadAsWispAtRuntimeTest.java b/test/jdk/com/alibaba/wisp/thread/TestDisableThreadAsWispAtRuntime.java similarity index 88% rename from test/jdk/com/alibaba/wisp/thread/DisableThreadAsWispAtRuntimeTest.java rename to test/jdk/com/alibaba/wisp/thread/TestDisableThreadAsWispAtRuntime.java index 028216e23be..9e2e620324e 100644 --- a/test/jdk/com/alibaba/wisp/thread/DisableThreadAsWispAtRuntimeTest.java +++ b/test/jdk/com/alibaba/wisp/thread/TestDisableThreadAsWispAtRuntime.java @@ -4,8 +4,8 @@ * @modules java.base/jdk.internal.access * @modules java.base/com.alibaba.wisp.engine:+open * @library /test/lib - * @run main/othervm -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true DisableThreadAsWispAtRuntimeTest - * @run main/othervm -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 DisableThreadAsWispAtRuntimeTest + * @run main/othervm -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true TestDisableThreadAsWispAtRuntime + * @run main/othervm -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestDisableThreadAsWispAtRuntime */ import com.alibaba.wisp.engine.WispEngine; @@ -21,7 +21,7 @@ import static jdk.test.lib.Asserts.assertEQ; -public class DisableThreadAsWispAtRuntimeTest { +public class TestDisableThreadAsWispAtRuntime { private static int wisp_version; @@ -30,7 +30,7 @@ public static void main(String[] args) throws Exception { System.setProperty("com.alibaba.wisp.config", f.getAbsolutePath()); f.deleteOnExit(); FileWriter writer = new FileWriter(f); - writer.write("com.alibaba.wisp.biz.manage=DisableThreadAsWispAtRuntimeTest::main\n"); + writer.write("com.alibaba.wisp.biz.manage=TestDisableThreadAsWispAtRuntime::main\n"); writer.close(); // WispBizSniffer has already been loaded; @@ -50,7 +50,7 @@ public static void main(String[] args) throws Exception { boolean on = i % 2 == 0; switchShift(on); for (int j = 0; j < 50; j++) { - assertEQ(on, es.submit(DisableThreadAsWispAtRuntimeTest::inCoroutine).get()); + assertEQ(on, es.submit(TestDisableThreadAsWispAtRuntime::inCoroutine).get()); } } diff --git a/test/jdk/com/alibaba/wisp/thread/EngineExecutorTest.java b/test/jdk/com/alibaba/wisp/thread/TestEngineExecutor.java similarity index 89% rename from test/jdk/com/alibaba/wisp/thread/EngineExecutorTest.java rename to test/jdk/com/alibaba/wisp/thread/TestEngineExecutor.java index f0473c8c42e..6907b458186 100644 --- a/test/jdk/com/alibaba/wisp/thread/EngineExecutorTest.java +++ b/test/jdk/com/alibaba/wisp/thread/TestEngineExecutor.java @@ -2,8 +2,8 @@ * @test * @summary test submit task to engine. * @modules java.base/jdk.internal.access - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true EngineExecutorTest - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 EngineExecutorTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true TestEngineExecutor + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestEngineExecutor */ import com.alibaba.wisp.engine.WispEngine; @@ -14,7 +14,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; -public class EngineExecutorTest { +public class TestEngineExecutor { public static void main(String[] args) throws Exception { testExecutor(); } diff --git a/test/jdk/com/alibaba/wisp/thread/InterruptTest.java b/test/jdk/com/alibaba/wisp/thread/TestInterrupt.java similarity index 94% rename from test/jdk/com/alibaba/wisp/thread/InterruptTest.java rename to test/jdk/com/alibaba/wisp/thread/TestInterrupt.java index cfecce6afd3..295d267e5fa 100644 --- a/test/jdk/com/alibaba/wisp/thread/InterruptTest.java +++ b/test/jdk/com/alibaba/wisp/thread/TestInterrupt.java @@ -1,8 +1,8 @@ /* * @test * @summary test thread.interrupt() of wispTask - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true InterruptTest - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 InterruptTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true TestInterrupt + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestInterrupt */ import com.alibaba.wisp.engine.WispEngine; @@ -16,7 +16,7 @@ import java.util.concurrent.locks.ReentrantLock; import java.util.concurrent.CountDownLatch; -public class InterruptTest { +public class TestInterrupt { public static void main(String[] args) throws Exception { Lock lock = new ReentrantLock(); Condition dummy = lock.newCondition(); diff --git a/test/jdk/com/alibaba/wisp/thread/InterruptedSleepTest.java b/test/jdk/com/alibaba/wisp/thread/TestInterruptedSleep.java similarity index 87% rename from test/jdk/com/alibaba/wisp/thread/InterruptedSleepTest.java rename to test/jdk/com/alibaba/wisp/thread/TestInterruptedSleep.java index 6c705ab7bd4..34743af1ef9 100644 --- a/test/jdk/com/alibaba/wisp/thread/InterruptedSleepTest.java +++ b/test/jdk/com/alibaba/wisp/thread/TestInterruptedSleep.java @@ -2,8 +2,8 @@ * @test * @summary test InterruptedException was thrown by sleep() * @library /test/lib - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true InterruptedSleepTest - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 InterruptedSleepTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true TestInterruptedSleep + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestInterruptedSleep */ import com.alibaba.wisp.engine.WispEngine; @@ -12,7 +12,7 @@ import static jdk.test.lib.Asserts.assertLessThan; import static jdk.test.lib.Asserts.assertTrue; -public class InterruptedSleepTest { +public class TestInterruptedSleep { public static void main(String[] args) { Thread mainCoro = Thread.currentThread(); WispEngine.dispatch(() -> { diff --git a/test/jdk/com/alibaba/wisp/thread/IsAliveTest.java b/test/jdk/com/alibaba/wisp/thread/TestIsAlive.java similarity index 92% rename from test/jdk/com/alibaba/wisp/thread/IsAliveTest.java rename to test/jdk/com/alibaba/wisp/thread/TestIsAlive.java index b47ba747f0b..111b4d42f45 100644 --- a/test/jdk/com/alibaba/wisp/thread/IsAliveTest.java +++ b/test/jdk/com/alibaba/wisp/thread/TestIsAlive.java @@ -3,8 +3,8 @@ * @summary test thread.isAlive() of wispTask * @modules java.base/com.alibaba.wisp.engine:+open * @library /test/lib - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.enableThreadAsWisp=true IsAliveTest - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.enableThreadAsWisp=true -Dcom.alibaba.wisp.version=2 IsAliveTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.enableThreadAsWisp=true TestIsAlive + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.enableThreadAsWisp=true -Dcom.alibaba.wisp.version=2 TestIsAlive * */ @@ -20,7 +20,7 @@ import static jdk.test.lib.Asserts.assertTrue; -public class IsAliveTest { +public class TestIsAlive { public static void main(String[] args) throws Exception { testCurrentDispatch(); testContainerDispatch(); @@ -48,7 +48,7 @@ private static void testCurrentDispatch() { private static void testContainerDispatch() throws Exception { Field f = Class.forName("com.alibaba.wisp.engine.WispConfiguration").getDeclaredField("PUT_TO_MANAGED_THREAD_STACK_LIST"); f.setAccessible(true); - f.set(null, Collections.singletonList("IsAliveTest::testContainerDispatch")); + f.set(null, Collections.singletonList("TestIsAlive::testContainerDispatch")); AtomicBoolean finish = new AtomicBoolean(); Thread t = new Thread(() -> finish.set(true)); t.start(); diff --git a/test/jdk/com/alibaba/wisp/thread/PreemptTest.java b/test/jdk/com/alibaba/wisp/thread/TestPreempt.java similarity index 88% rename from test/jdk/com/alibaba/wisp/thread/PreemptTest.java rename to test/jdk/com/alibaba/wisp/thread/TestPreempt.java index 6384968d864..2321ead0b43 100644 --- a/test/jdk/com/alibaba/wisp/thread/PreemptTest.java +++ b/test/jdk/com/alibaba/wisp/thread/TestPreempt.java @@ -2,8 +2,7 @@ * @test * @summary test wisp time slice preempt * @library /test/lib - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.carrierEngines=1 -Dcom.alibaba.wisp.enableHandOff=true -Dcom.alibaba.wisp.version=2 PreemptTest - + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.carrierEngines=1 -Dcom.alibaba.wisp.enableHandOff=true -Dcom.alibaba.wisp.version=2 TestPreempt */ import com.alibaba.wisp.engine.WispWorkerContainer; @@ -16,10 +15,10 @@ import static jdk.test.lib.Asserts.assertTrue; -public class PreemptTest { +public class TestPreempt { public static void main(String[] args) throws Exception { - doTest(PreemptTest::complexLoop); - doTest(PreemptTest::simpleLoop); + doTest(TestPreempt::complexLoop); + doTest(TestPreempt::simpleLoop); } private static void doTest(Runnable r) throws Exception { diff --git a/test/jdk/com/alibaba/wisp/thread/SubmittedTaskLimitTest.java b/test/jdk/com/alibaba/wisp/thread/TestSubmittedTaskLimit.java similarity index 95% rename from test/jdk/com/alibaba/wisp/thread/SubmittedTaskLimitTest.java rename to test/jdk/com/alibaba/wisp/thread/TestSubmittedTaskLimit.java index cc625bbec37..4ea218c1aaa 100644 --- a/test/jdk/com/alibaba/wisp/thread/SubmittedTaskLimitTest.java +++ b/test/jdk/com/alibaba/wisp/thread/TestSubmittedTaskLimit.java @@ -3,7 +3,7 @@ * @summary Test to verify threshold setting for submitted wisp tasks. * @modules java.base/com.alibaba.wisp.engine:+open * @library /test/lib - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true SubmittedTaskLimitTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true TestSubmittedTaskLimit */ import com.alibaba.wisp.engine.WispEngine; @@ -19,7 +19,7 @@ import static jdk.test.lib.Asserts.assertTrue; -public class SubmittedTaskLimitTest { +public class TestSubmittedTaskLimit { private static final int SLEEP_TIME = 400; public static void main(String[] args) throws Exception { diff --git a/test/jdk/com/alibaba/wisp/thread/ThrowErrorTest.java b/test/jdk/com/alibaba/wisp/thread/TestThrowError.java similarity index 82% rename from test/jdk/com/alibaba/wisp/thread/ThrowErrorTest.java rename to test/jdk/com/alibaba/wisp/thread/TestThrowError.java index cc04e8a7f4d..a3dad90c279 100644 --- a/test/jdk/com/alibaba/wisp/thread/ThrowErrorTest.java +++ b/test/jdk/com/alibaba/wisp/thread/TestThrowError.java @@ -2,15 +2,15 @@ * @test * @summary test coroutine throw Error * @library /test/lib - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true ThrowErrorTest - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 ThrowErrorTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true TestThrowError + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestThrowError */ import com.alibaba.wisp.engine.WispEngine; import static jdk.test.lib.Asserts.assertTrue; -public class ThrowErrorTest { +public class TestThrowError { public static void main(String[] args) { WispEngine.dispatch(() -> { throw new Error(); diff --git a/test/jdk/com/alibaba/wisp/thread/YieldTest.java b/test/jdk/com/alibaba/wisp/thread/TestYield.java similarity index 91% rename from test/jdk/com/alibaba/wisp/thread/YieldTest.java rename to test/jdk/com/alibaba/wisp/thread/TestYield.java index 5cd318991b1..2a4093b01ea 100644 --- a/test/jdk/com/alibaba/wisp/thread/YieldTest.java +++ b/test/jdk/com/alibaba/wisp/thread/TestYield.java @@ -2,14 +2,14 @@ * @test * @summary test yield() * @library /test/lib - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true YieldTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true TestYield */ import com.alibaba.wisp.engine.WispEngine; import static jdk.test.lib.Asserts.*; -public class YieldTest { +public class TestYield { private static int i = 0; public static void main(String[] args) { WispEngine.dispatch(() -> { diff --git a/test/jdk/com/alibaba/wisp/timer/DaemonThreadGroupTest.java b/test/jdk/com/alibaba/wisp/timer/TestDaemonThreadGroup.java similarity index 93% rename from test/jdk/com/alibaba/wisp/timer/DaemonThreadGroupTest.java rename to test/jdk/com/alibaba/wisp/timer/TestDaemonThreadGroup.java index 158762bc5a4..dce58ad100e 100644 --- a/test/jdk/com/alibaba/wisp/timer/DaemonThreadGroupTest.java +++ b/test/jdk/com/alibaba/wisp/timer/TestDaemonThreadGroup.java @@ -4,7 +4,7 @@ * @summary Test Daemon Thread Group implementation * @modules java.base/jdk.internal.access * @modules java.base/com.alibaba.wisp.engine:+open - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 -Dcom.alibaba.wisp.useCarrierAsPoller=false DaemonThreadGroupTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 -Dcom.alibaba.wisp.useCarrierAsPoller=false TestDaemonThreadGroup */ @@ -23,7 +23,7 @@ /** * test the Daemon Thread Group implementation */ -public class DaemonThreadGroupTest { +public class TestDaemonThreadGroup { public static void main(String... arg) throws Exception { Field f = Class.forName("com.alibaba.wisp.engine.WispEngine").getDeclaredField("pollerThread"); f.setAccessible(true); diff --git a/test/jdk/com/alibaba/wisp/timer/OverflowTest.java b/test/jdk/com/alibaba/wisp/timer/TestOverflow.java similarity index 93% rename from test/jdk/com/alibaba/wisp/timer/OverflowTest.java rename to test/jdk/com/alibaba/wisp/timer/TestOverflow.java index 8bec4d74c02..78e4e5a7ff6 100644 --- a/test/jdk/com/alibaba/wisp/timer/OverflowTest.java +++ b/test/jdk/com/alibaba/wisp/timer/TestOverflow.java @@ -3,8 +3,8 @@ * @library /test/lib * @summary Test timer implementation * @modules java.base/jdk.internal.access - * @run main/othervm -XX:+EnableCoroutine OverflowTest - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.version=2 OverflowTest + * @run main/othervm -XX:+EnableCoroutine TestOverflow + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.version=2 TestOverflow */ @@ -22,7 +22,7 @@ /** * test the time out implementation */ -public class OverflowTest { +public class TestOverflow { public static void main(String... arg) throws Exception { WispEngineAccess access = SharedSecrets.getWispEngineAccess(); diff --git a/test/jdk/com/alibaba/wisp/timer/PriorityQueueSortTest.java b/test/jdk/com/alibaba/wisp/timer/TestPriorityQueueSort.java similarity index 97% rename from test/jdk/com/alibaba/wisp/timer/PriorityQueueSortTest.java rename to test/jdk/com/alibaba/wisp/timer/TestPriorityQueueSort.java index 5e2f1d8cf1f..5d834b5f732 100644 --- a/test/jdk/com/alibaba/wisp/timer/PriorityQueueSortTest.java +++ b/test/jdk/com/alibaba/wisp/timer/TestPriorityQueueSort.java @@ -3,7 +3,7 @@ * @library /test/lib * @summary Test TimeOut.Queue's offer and remove function, make sure it's consistent with the behavior of the jdk's priority queue * @modules java.base/com.alibaba.wisp.engine:+open - * @run main/othervm PriorityQueueSortTest + * @run main/othervm TestPriorityQueueSort */ import com.alibaba.wisp.engine.TimeOut; @@ -16,7 +16,7 @@ import static jdk.test.lib.Asserts.assertTrue; -public class PriorityQueueSortTest { +public class TestPriorityQueueSort { static Class classQ; static Class classT; diff --git a/test/jdk/com/alibaba/wisp/timer/SleepTest.java b/test/jdk/com/alibaba/wisp/timer/TestSleep.java similarity index 93% rename from test/jdk/com/alibaba/wisp/timer/SleepTest.java rename to test/jdk/com/alibaba/wisp/timer/TestSleep.java index b6596888c90..deb570300a2 100644 --- a/test/jdk/com/alibaba/wisp/timer/SleepTest.java +++ b/test/jdk/com/alibaba/wisp/timer/TestSleep.java @@ -2,7 +2,7 @@ * @test * @summary test sleep * @library /test/lib - * @run main/othervm -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.enableThreadAsWisp=true -Dcom.alibaba.wisp.version=2 SleepTest + * @run main/othervm -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.enableThreadAsWisp=true -Dcom.alibaba.wisp.version=2 TestSleep */ import com.alibaba.wisp.engine.WispEngine; @@ -13,7 +13,7 @@ import static jdk.test.lib.Asserts.assertTrue; -public class SleepTest { +public class TestSleep { public static void main(String[] args) { assertTrue(IntStream.range(0, 100).parallel().allMatch(ms -> { long start = System.currentTimeMillis(); diff --git a/test/jdk/com/alibaba/wisp/timer/SleepRPCTest.java b/test/jdk/com/alibaba/wisp/timer/TestSleepRPC.java similarity index 92% rename from test/jdk/com/alibaba/wisp/timer/SleepRPCTest.java rename to test/jdk/com/alibaba/wisp/timer/TestSleepRPC.java index 93b48e07131..2050d1ab1f1 100644 --- a/test/jdk/com/alibaba/wisp/timer/SleepRPCTest.java +++ b/test/jdk/com/alibaba/wisp/timer/TestSleepRPC.java @@ -2,8 +2,8 @@ * @test * @summary test use sleep in RPC senorina * @library /test/lib - * @run main/othervm -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.enableThreadAsWisp=true SleepRPCTest - * @run main/othervm -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.enableThreadAsWisp=true -Dcom.alibaba.wisp.version=2 SleepRPCTest + * @run main/othervm -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.enableThreadAsWisp=true TestSleepRPC + * @run main/othervm -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.enableThreadAsWisp=true -Dcom.alibaba.wisp.version=2 TestSleepRPC */ import com.alibaba.wisp.engine.WispEngine; @@ -18,7 +18,7 @@ import static jdk.test.lib.Asserts.assertTrue; -public class SleepRPCTest { +public class TestSleepRPC { public static void main(String[] args) { List> rpcs = IntStream.range(0, 50).mapToObj(i -> { diff --git a/test/jdk/com/alibaba/wisp/timer/TimerTest.java b/test/jdk/com/alibaba/wisp/timer/TestTimer.java similarity index 89% rename from test/jdk/com/alibaba/wisp/timer/TimerTest.java rename to test/jdk/com/alibaba/wisp/timer/TestTimer.java index 14079946dc6..1bf9c104da0 100644 --- a/test/jdk/com/alibaba/wisp/timer/TimerTest.java +++ b/test/jdk/com/alibaba/wisp/timer/TestTimer.java @@ -2,8 +2,8 @@ * @test * @summary Test timer implement * @modules java.base/jdk.internal.access - * @run main/othervm -XX:+EnableCoroutine TimerTest - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.version=2 TimerTest + * @run main/othervm -XX:+EnableCoroutine TestTimer + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.version=2 TestTimer */ @@ -15,7 +15,7 @@ /** * test the time out implement */ -public class TimerTest { +public class TestTimer { public static void main(String... arg) throws Exception { WispEngine.dispatch(() -> { long ts = System.currentTimeMillis(); diff --git a/test/jdk/com/alibaba/wisp2/AjustCarrierTest.java b/test/jdk/com/alibaba/wisp2/TestAjustCarrier.java similarity index 97% rename from test/jdk/com/alibaba/wisp2/AjustCarrierTest.java rename to test/jdk/com/alibaba/wisp2/TestAjustCarrier.java index d71715e334c..93f7859c4a9 100644 --- a/test/jdk/com/alibaba/wisp2/AjustCarrierTest.java +++ b/test/jdk/com/alibaba/wisp2/TestAjustCarrier.java @@ -3,7 +3,7 @@ * @library /test/lib * @summary test for adjusting carrier number at runtime * @modules java.base/com.alibaba.wisp.engine:+open - * @run main/othervm -XX:+UseWisp2 -Dcom.alibaba.wisp.growCarrierTickUs=200000 AjustCarrierTest + * @run main/othervm -XX:+UseWisp2 -Dcom.alibaba.wisp.growCarrierTickUs=200000 TestAjustCarrier */ @@ -16,7 +16,7 @@ import static jdk.test.lib.Asserts.assertTrue; -public class AjustCarrierTest { +public class TestAjustCarrier { public static void main(String[] args) throws Exception{ Thread.currentThread().setName("Wisp-Sysmon"); Class claz = Class.forName("com.alibaba.wisp.engine.Wisp2Scheduler"); diff --git a/test/jdk/com/alibaba/wisp2/AllThreadAsWispTest.java b/test/jdk/com/alibaba/wisp2/TestAllThreadAsWisp.java similarity index 94% rename from test/jdk/com/alibaba/wisp2/AllThreadAsWispTest.java rename to test/jdk/com/alibaba/wisp2/TestAllThreadAsWisp.java index a5acdc1f90f..6101040cbe4 100644 --- a/test/jdk/com/alibaba/wisp2/AllThreadAsWispTest.java +++ b/test/jdk/com/alibaba/wisp2/TestAllThreadAsWisp.java @@ -3,7 +3,7 @@ * @library /test/lib * @summary convert all thread to wisp * @modules java.base/jdk.internal.access - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 -XX:+UseWispMonitor -Dcom.alibaba.wisp.enableThreadAsWisp=true -Dcom.alibaba.wisp.allThreadAsWisp=true AllThreadAsWispTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 -XX:+UseWispMonitor -Dcom.alibaba.wisp.enableThreadAsWisp=true -Dcom.alibaba.wisp.allThreadAsWisp=true TestAllThreadAsWisp */ import jdk.internal.access.SharedSecrets; @@ -16,7 +16,7 @@ import static jdk.test.lib.Asserts.assertTrue; -public class AllThreadAsWispTest { +public class TestAllThreadAsWisp { public static void main(String[] args) throws Exception { CountDownLatch done = new CountDownLatch(60); diff --git a/test/jdk/com/alibaba/wisp2/CtxClassLoaderInheritanceTest.java b/test/jdk/com/alibaba/wisp2/TestCtxClassLoaderInheritance.java similarity index 89% rename from test/jdk/com/alibaba/wisp2/CtxClassLoaderInheritanceTest.java rename to test/jdk/com/alibaba/wisp2/TestCtxClassLoaderInheritance.java index a25e37dd8a6..4b8f2cca8f3 100644 --- a/test/jdk/com/alibaba/wisp2/CtxClassLoaderInheritanceTest.java +++ b/test/jdk/com/alibaba/wisp2/TestCtxClassLoaderInheritance.java @@ -2,7 +2,7 @@ * @test * @library /test/lib * @summary test context ClassLoader inherit. - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 -XX:+UseWispMonitor -Dcom.alibaba.wisp.enableThreadAsWisp=true -Dcom.alibaba.wisp.allThreadAsWisp=true CtxClassLoaderInheritanceTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 -XX:+UseWispMonitor -Dcom.alibaba.wisp.enableThreadAsWisp=true -Dcom.alibaba.wisp.allThreadAsWisp=true TestCtxClassLoaderInheritance */ import java.util.concurrent.CountDownLatch; @@ -10,7 +10,7 @@ import static jdk.test.lib.Asserts.assertEQ; -public class CtxClassLoaderInheritanceTest { +public class TestCtxClassLoaderInheritance { public static void main(String[] args) throws Exception { ClassLoader cl = new ClassLoader() { }; diff --git a/test/jdk/com/alibaba/wisp2/DispatchTest.java b/test/jdk/com/alibaba/wisp2/TestDispatch.java similarity index 73% rename from test/jdk/com/alibaba/wisp2/DispatchTest.java rename to test/jdk/com/alibaba/wisp2/TestDispatch.java index 00c9c45e714..7252728d764 100644 --- a/test/jdk/com/alibaba/wisp2/DispatchTest.java +++ b/test/jdk/com/alibaba/wisp2/TestDispatch.java @@ -2,14 +2,14 @@ * @test * @summary basic wisp2 * @modules java.base/jdk.internal.access - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 -XX:+UseWispMonitor DispatchTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 -XX:+UseWispMonitor TestDispatch */ import com.alibaba.wisp.engine.WispEngine; import jdk.internal.access.SharedSecrets; -public class DispatchTest { +public class TestDispatch { public static void main(String[] args) throws Exception { WispEngine.dispatch(() -> { for (int i = 0; i < 9999999; i++) { @@ -21,7 +21,7 @@ public static void main(String[] args) throws Exception { } } }); - System.out.println("DispatchTest.main"); + System.out.println("TestDispatch.main"); Thread.sleep(1000); } } diff --git a/test/jdk/com/alibaba/wisp2/EpollWakeupPerfTest.java b/test/jdk/com/alibaba/wisp2/TestEpollWakeupPerf.java similarity index 95% rename from test/jdk/com/alibaba/wisp2/EpollWakeupPerfTest.java rename to test/jdk/com/alibaba/wisp2/TestEpollWakeupPerf.java index cf631149bd0..b2a995b4bcd 100644 --- a/test/jdk/com/alibaba/wisp2/EpollWakeupPerfTest.java +++ b/test/jdk/com/alibaba/wisp2/TestEpollWakeupPerf.java @@ -1,7 +1,7 @@ /* * @test * @summary test selector.wakeup() performance - * @run main/othervm -XX:+UseWisp2 EpollWakeupPerfTest + * @run main/othervm -XX:+UseWisp2 TestEpollWakeupPerf */ import java.nio.channels.Selector; @@ -11,7 +11,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; -public class EpollWakeupPerfTest { +public class TestEpollWakeupPerf { public static void main(String[] args) throws Exception { Selector selector = Selector.open(); AtomicLong wakenedTs = new AtomicLong(); diff --git a/test/jdk/com/alibaba/wisp2/HandOffTest.java b/test/jdk/com/alibaba/wisp2/TestHandOff.java similarity index 94% rename from test/jdk/com/alibaba/wisp2/HandOffTest.java rename to test/jdk/com/alibaba/wisp2/TestHandOff.java index 0998094c9b4..be5a91e166b 100644 --- a/test/jdk/com/alibaba/wisp2/HandOffTest.java +++ b/test/jdk/com/alibaba/wisp2/TestHandOff.java @@ -2,7 +2,7 @@ * @test * @library /test/lib * @summary test long running or blocking syscall task could be retaken - * @run main/othervm -Dcom.alibaba.wisp.carrierEngines=1 -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 -Dcom.alibaba.wisp.enableHandOff=true -Dcom.alibaba.wisp.handoffPolicy=ADAPTIVE -Dcom.alibaba.wisp.sysmonTickUs=100000 HandOffTest + * @run main/othervm -Dcom.alibaba.wisp.carrierEngines=1 -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 -Dcom.alibaba.wisp.enableHandOff=true -Dcom.alibaba.wisp.handoffPolicy=ADAPTIVE -Dcom.alibaba.wisp.sysmonTickUs=100000 TestHandOff */ import com.alibaba.wisp.engine.WispEngine; @@ -17,7 +17,7 @@ import static jdk.test.lib.Asserts.assertTrue; -public class HandOffTest { +public class TestHandOff { public static void main(String[] args) throws Exception { CountDownLatch cl = new CountDownLatch(10); for (int i = 0; i < 10; i++) { diff --git a/test/jdk/com/alibaba/wisp2/HandOffWithStealTest.java b/test/jdk/com/alibaba/wisp2/TestHandOffWithSteal.java similarity index 93% rename from test/jdk/com/alibaba/wisp2/HandOffWithStealTest.java rename to test/jdk/com/alibaba/wisp2/TestHandOffWithSteal.java index 4b8ab13fe05..54475ec634d 100644 --- a/test/jdk/com/alibaba/wisp2/HandOffWithStealTest.java +++ b/test/jdk/com/alibaba/wisp2/TestHandOffWithSteal.java @@ -2,7 +2,7 @@ * @test * @library /test/lib * @summary test long running or blocking syscall task could be retaken - * @run main/othervm -Dcom.alibaba.wisp.carrierEngines=1 -XX:+UseWisp2 -Dcom.alibaba.wisp.handoffPolicy=ADAPTIVE HandOffWithStealTest + * @run main/othervm -Dcom.alibaba.wisp.carrierEngines=1 -XX:+UseWisp2 -Dcom.alibaba.wisp.handoffPolicy=ADAPTIVE TestHandOffWithSteal */ import com.alibaba.wisp.engine.WispEngine; @@ -17,7 +17,7 @@ import static jdk.test.lib.Asserts.assertTrue; -public class HandOffWithStealTest { +public class TestHandOffWithSteal { public static void main(String[] args) throws Exception { final int N = 100; CountDownLatch cl = new CountDownLatch(N); diff --git a/test/jdk/com/alibaba/wisp2/MonolithicPollTest.java b/test/jdk/com/alibaba/wisp2/TestMonolithicPoll.java similarity index 93% rename from test/jdk/com/alibaba/wisp2/MonolithicPollTest.java rename to test/jdk/com/alibaba/wisp2/TestMonolithicPoll.java index 7e059c78f1b..080d005b5b9 100644 --- a/test/jdk/com/alibaba/wisp2/MonolithicPollTest.java +++ b/test/jdk/com/alibaba/wisp2/TestMonolithicPoll.java @@ -4,8 +4,8 @@ * @summary verify epollArray is set for Selector.select() * @modules java.base/jdk.internal.access * @modules java.base/com.alibaba.wisp.engine:+open - * @run main/othervm -XX:+UseWisp2 -Dcom.alibaba.wisp.monolithicPoll=true MonolithicPollTest - * @run main/othervm -XX:+UseWisp2 -Dcom.alibaba.wisp.monolithicPoll=false MonolithicPollTest + * @run main/othervm -XX:+UseWisp2 -Dcom.alibaba.wisp.monolithicPoll=true TestMonolithicPoll + * @run main/othervm -XX:+UseWisp2 -Dcom.alibaba.wisp.monolithicPoll=false TestMonolithicPoll */ import com.alibaba.wisp.engine.WispTask; @@ -18,7 +18,7 @@ import static jdk.test.lib.Asserts.assertEQ; -public class MonolithicPollTest { +public class TestMonolithicPoll { public static void main(String[] args) throws Exception { AtomicReference task = new AtomicReference<>(); Executors.newSingleThreadExecutor().submit(() -> { diff --git a/test/jdk/com/alibaba/wisp2/NioBlockingAcceptTest.java b/test/jdk/com/alibaba/wisp2/TestNioBlockingAccept.java similarity index 92% rename from test/jdk/com/alibaba/wisp2/NioBlockingAcceptTest.java rename to test/jdk/com/alibaba/wisp2/TestNioBlockingAccept.java index b881820b84b..4d35dd91c63 100644 --- a/test/jdk/com/alibaba/wisp2/NioBlockingAcceptTest.java +++ b/test/jdk/com/alibaba/wisp2/TestNioBlockingAccept.java @@ -2,7 +2,7 @@ * @test * @library /test/lib * @summary test nio blocking accept - * @run main/othervm -Dcom.alibaba.wisp.carrierEngines=1 -XX:ActiveProcessorCount=1 -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 -XX:+UseWispMonitor -Dcom.alibaba.wisp.enableThreadAsWisp=true -Dcom.alibaba.wisp.allThreadAsWisp=true NioBlockingAcceptTest + * @run main/othervm -Dcom.alibaba.wisp.carrierEngines=1 -XX:ActiveProcessorCount=1 -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 -XX:+UseWispMonitor -Dcom.alibaba.wisp.enableThreadAsWisp=true -Dcom.alibaba.wisp.allThreadAsWisp=true TestNioBlockingAccept */ import com.alibaba.wisp.engine.WispEngine; @@ -15,7 +15,7 @@ import static jdk.test.lib.Asserts.assertTrue; -public class NioBlockingAcceptTest { +public class TestNioBlockingAccept { public static void main(String[] args) throws Exception { WispEngine.dispatch(() -> { try { diff --git a/test/jdk/com/alibaba/wisp2/ReuseWispTaskAfterThreadJoinTest.java b/test/jdk/com/alibaba/wisp2/TestReuseWispTaskAfterThreadJoin.java similarity index 87% rename from test/jdk/com/alibaba/wisp2/ReuseWispTaskAfterThreadJoinTest.java rename to test/jdk/com/alibaba/wisp2/TestReuseWispTaskAfterThreadJoin.java index cbc9c8b4e99..bd1a8aee38b 100644 --- a/test/jdk/com/alibaba/wisp2/ReuseWispTaskAfterThreadJoinTest.java +++ b/test/jdk/com/alibaba/wisp2/TestReuseWispTaskAfterThreadJoin.java @@ -2,12 +2,12 @@ * @test * @library /test/lib * @summary test wisp task reusing after thread.join() - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 -XX:+UseWispMonitor -Dcom.alibaba.wisp.enableThreadAsWisp=true -Dcom.alibaba.wisp.allThreadAsWisp=true ReuseWispTaskAfterThreadJoinTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 -XX:+UseWispMonitor -Dcom.alibaba.wisp.enableThreadAsWisp=true -Dcom.alibaba.wisp.allThreadAsWisp=true TestReuseWispTaskAfterThreadJoin */ import com.alibaba.wisp.engine.WispEngine; -public class ReuseWispTaskAfterThreadJoinTest { +public class TestReuseWispTaskAfterThreadJoin { public static void main(String[] args) throws Exception { Thread t = new Thread(() -> { diff --git a/test/jdk/com/alibaba/wisp2/ThreadAsWispBlackListTest.java b/test/jdk/com/alibaba/wisp2/TestThreadAsWispBlackList.java similarity index 82% rename from test/jdk/com/alibaba/wisp2/ThreadAsWispBlackListTest.java rename to test/jdk/com/alibaba/wisp2/TestThreadAsWispBlackList.java index ac81f869417..87764bb0995 100644 --- a/test/jdk/com/alibaba/wisp2/ThreadAsWispBlackListTest.java +++ b/test/jdk/com/alibaba/wisp2/TestThreadAsWispBlackList.java @@ -4,7 +4,7 @@ * @summary test all thread as wisp black list * @modules java.base/jdk.internal.access * @modules java.base/com.alibaba.wisp.engine:+open - * @run main/othervm -XX:+UseWisp2 ThreadAsWispBlackListTest + * @run main/othervm -XX:+UseWisp2 TestThreadAsWispBlackList */ import jdk.internal.access.SharedSecrets; @@ -17,9 +17,9 @@ import static jdk.test.lib.Asserts.assertFalse; import static jdk.test.lib.Asserts.assertTrue; -public class ThreadAsWispBlackListTest { +public class TestThreadAsWispBlackList { public static void main(String[] args) throws Exception { - assertFalse(Executors.newSingleThreadExecutor().submit(ThreadAsWispBlackListTest::isRealThread).get()); + assertFalse(Executors.newSingleThreadExecutor().submit(TestThreadAsWispBlackList::isRealThread).get()); byClass(); byPackage(); byName(); @@ -30,11 +30,11 @@ public static void main(String[] args) throws Exception { private static void byPackage() throws Exception { setBlackList("package:java.util.concurrent"); - assertTrue(Executors.newSingleThreadExecutor().submit(ThreadAsWispBlackListTest::isRealThread).get()); + assertTrue(Executors.newSingleThreadExecutor().submit(TestThreadAsWispBlackList::isRealThread).get()); } private static void byClass() throws Exception { - FutureTask future = new FutureTask<>(ThreadAsWispBlackListTest::isRealThread); + FutureTask future = new FutureTask<>(TestThreadAsWispBlackList::isRealThread); class T1 extends Thread { @Override public void run() { @@ -78,24 +78,24 @@ private static void wildcardTest() throws Exception { private static void wildcardTest1(String pattern, String name) throws Exception { setBlackList("name:" + pattern); - FutureTask future = new FutureTask<>(ThreadAsWispBlackListTest::isRealThread); + FutureTask future = new FutureTask<>(TestThreadAsWispBlackList::isRealThread); new Thread(future, name).start(); assertTrue(future.get()); } private static void testCommonPool() throws Exception { setBlackList("name:ForkJoinPool.commonPool-worker-*"); - FutureTask future = new FutureTask<>(ThreadAsWispBlackListTest::isRealThread); + FutureTask future = new FutureTask<>(TestThreadAsWispBlackList::isRealThread); ForkJoinPool.commonPool().execute(future); assertTrue(future.get()); } private static void testMultiEntry() throws Exception { setBlackList("name:m1111;name:m2222"); - FutureTask future = new FutureTask<>(ThreadAsWispBlackListTest::isRealThread); + FutureTask future = new FutureTask<>(TestThreadAsWispBlackList::isRealThread); new Thread(future, "m1111").start(); assertTrue(future.get()); - future = new FutureTask<>(ThreadAsWispBlackListTest::isRealThread); + future = new FutureTask<>(TestThreadAsWispBlackList::isRealThread); new Thread(future, "m2222").start(); assertTrue(future.get()); } diff --git a/test/jdk/com/alibaba/wisp2/ThreadJoinTest.java b/test/jdk/com/alibaba/wisp2/TestThreadJoin.java similarity index 92% rename from test/jdk/com/alibaba/wisp2/ThreadJoinTest.java rename to test/jdk/com/alibaba/wisp2/TestThreadJoin.java index 1d9b0847106..87e5ceb5c13 100644 --- a/test/jdk/com/alibaba/wisp2/ThreadJoinTest.java +++ b/test/jdk/com/alibaba/wisp2/TestThreadJoin.java @@ -2,12 +2,12 @@ * @test * @library /test/lib * @summary test thread.join() - * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 -XX:+UseWispMonitor -Dcom.alibaba.wisp.enableThreadAsWisp=true -Dcom.alibaba.wisp.allThreadAsWisp=true ThreadJoinTest + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 -XX:+UseWispMonitor -Dcom.alibaba.wisp.enableThreadAsWisp=true -Dcom.alibaba.wisp.allThreadAsWisp=true TestThreadJoin */ import com.alibaba.wisp.engine.WispEngine; -public class ThreadJoinTest { +public class TestThreadJoin { public static void main(String[] args) throws Exception { Thread t = new Thread(() -> { try { diff --git a/test/jdk/com/alibaba/wisp2/TimedWaitTest.java b/test/jdk/com/alibaba/wisp2/TestTimedWait.java similarity index 92% rename from test/jdk/com/alibaba/wisp2/TimedWaitTest.java rename to test/jdk/com/alibaba/wisp2/TestTimedWait.java index 70527944cf0..b9d4b795889 100644 --- a/test/jdk/com/alibaba/wisp2/TimedWaitTest.java +++ b/test/jdk/com/alibaba/wisp2/TestTimedWait.java @@ -1,14 +1,14 @@ /* * @test * @summary test timed Jvm park - * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TimedWaitTest + * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestTimedWait */ import com.alibaba.wisp.engine.WispEngine; import java.util.concurrent.CountDownLatch; -public class TimedWaitTest { +public class TestTimedWait { public static void main(String[] args) throws InterruptedException { CountDownLatch latch = new CountDownLatch(4); for (int i = 0; i < 4; i++) { diff --git a/test/jdk/com/alibaba/wisp2/TestWisp2Group.java b/test/jdk/com/alibaba/wisp2/TestWisp2Group.java new file mode 100644 index 00000000000..01579c0c8e7 --- /dev/null +++ b/test/jdk/com/alibaba/wisp2/TestWisp2Group.java @@ -0,0 +1,118 @@ +/* + * @test + * @summary Test WispCounter removing during the shutdown of Wisp2Group + * @library /test/lib + * @modules java.base/jdk.internal.access + * @modules java.base/com.alibaba.wisp.engine:+open + * @run main/othervm -XX:+EnableCoroutine -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 -XX:+UseWispMonitor -Dcom.alibaba.wisp.enableHandOff=false TestWisp2Group + */ + +import com.alibaba.wisp.engine.WispEngine; +import com.alibaba.wisp.engine.Wisp2Group; +import com.alibaba.management.WispCounterMXBean; + +import javax.management.MBeanServer; +import java.io.*; +import java.lang.management.ManagementFactory; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.*; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; +import jdk.internal.access.SharedSecrets; +import static jdk.test.lib.Asserts.assertTrue; + +public class TestWisp2Group { + static WispMultiThreadExecutor executor; + static WispCounterMXBean mbean; + public static void main(String[] args) throws Exception { + + MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); + try { + mbean = ManagementFactory.newPlatformMXBeanProxy(mbs, + "com.alibaba.management:type=WispCounter", WispCounterMXBean.class); + } catch (IOException e) { + e.printStackTrace(); + } + + testWisp2Group(); + } + + private static void testWisp2Group() throws Exception { + executor = new WispMultiThreadExecutor(4, new ThreadFactory() { + AtomicInteger seq = new AtomicInteger(); + @Override + public Thread newThread(Runnable r) { + Thread t = new Thread(r, "Wisp2-Group-Test-Carrier-" + seq.getAndIncrement()); + t.setDaemon(true); + return t; + } + }); + Thread.sleep(500); + for (int j = 0; j < 10; ++j) { + executor.execute(RUN_COMPILED_BUSY_LOOP); + } + Thread.sleep(500); + List list = mbean.getRunningStates(); + System.out.println(list); + int size1 = list.size(); + executor.shutdown(); + executor.awaitTermination(5, TimeUnit.SECONDS); + list = mbean.getRunningStates(); + System.out.println(list); + int size2 = list.size(); + assertTrue((size1 - size2) == 4); + } + + // task running in compiled code + private static void decIt(long num) { + while (0 != num--); + } + + private static final Runnable RUN_COMPILED_BUSY_LOOP = () -> { + // warmup + for (int i = 0; i < 5000; ++i) { + decIt(i); + } + while (true) { + decIt(0xFFFFFFFFl); + } + }; + + static class WispMultiThreadExecutor extends AbstractExecutorService { + private final Wisp2Group delegated; + public WispMultiThreadExecutor(int threadCount, ThreadFactory threadFactory) { + delegated = Wisp2Group.createGroup(threadCount, threadFactory); + } + + @Override + public void execute(Runnable command) { + delegated.execute(command); + } + + @Override + public void shutdown() { + delegated.shutdown(); + } + + @Override + public List shutdownNow() { + return null; + } + + @Override + public boolean isShutdown() { + return false; + } + + @Override + public boolean isTerminated() { + return false; + } + + @Override + public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException { + return delegated.awaitTermination(timeout, unit); + } + } +} diff --git a/test/jdk/com/alibaba/wisp2/Wisp2ShutdownTest.java b/test/jdk/com/alibaba/wisp2/TestWisp2Shutdown.java similarity index 95% rename from test/jdk/com/alibaba/wisp2/Wisp2ShutdownTest.java rename to test/jdk/com/alibaba/wisp2/TestWisp2Shutdown.java index de9091d156e..1e2d82fdc59 100644 --- a/test/jdk/com/alibaba/wisp2/Wisp2ShutdownTest.java +++ b/test/jdk/com/alibaba/wisp2/TestWisp2Shutdown.java @@ -1,9 +1,9 @@ /* * @test - * @summary Wisp2ShutdownTest + * @summary TestWisp2Shutdown * @modules java.base/com.alibaba.wisp.engine:+open * @library /test/lib - * @run main/othervm -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 Wisp2ShutdownTest + * @run main/othervm -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestWisp2Shutdown */ import java.lang.reflect.Constructor; @@ -14,7 +14,7 @@ import static jdk.test.lib.Asserts.assertEQ; -public class Wisp2ShutdownTest { +public class TestWisp2Shutdown { public static void main(String[] args) throws Exception { AtomicInteger n = new AtomicInteger(); diff --git a/test/jdk/com/alibaba/wisp2/Wisp2TimerRemoveTest.java b/test/jdk/com/alibaba/wisp2/TestWisp2TimerRemove.java similarity index 97% rename from test/jdk/com/alibaba/wisp2/Wisp2TimerRemoveTest.java rename to test/jdk/com/alibaba/wisp2/TestWisp2TimerRemove.java index 2cf4ac42710..640b60ba591 100644 --- a/test/jdk/com/alibaba/wisp2/Wisp2TimerRemoveTest.java +++ b/test/jdk/com/alibaba/wisp2/TestWisp2TimerRemove.java @@ -4,7 +4,7 @@ * @modules java.base/jdk.internal.access * @modules java.base/com.alibaba.wisp.engine:+open * @summary verify canceled timers are removed ASAP - * @run main/othervm -XX:+UseWisp2 Wisp2TimerRemoveTest + * @run main/othervm -XX:+UseWisp2 TestWisp2TimerRemove */ import com.alibaba.wisp.engine.WispEngine; @@ -14,7 +14,7 @@ import static jdk.test.lib.Asserts.*; -public class Wisp2TimerRemoveTest { +public class TestWisp2TimerRemove { public static void main(String[] args) throws Exception { BlockingQueue q1 = new ArrayBlockingQueue<>(1); diff --git a/test/jdk/com/alibaba/wisp2/Wisp2WaitNotifyTest.java b/test/jdk/com/alibaba/wisp2/TestWisp2WaitNotify.java similarity index 92% rename from test/jdk/com/alibaba/wisp2/Wisp2WaitNotifyTest.java rename to test/jdk/com/alibaba/wisp2/TestWisp2WaitNotify.java index 42ab7b54624..d2251db93b9 100644 --- a/test/jdk/com/alibaba/wisp2/Wisp2WaitNotifyTest.java +++ b/test/jdk/com/alibaba/wisp2/TestWisp2WaitNotify.java @@ -2,7 +2,7 @@ * @test * @library /test/lib * @summary Test Object.wait/notify with coroutine in wisp2 - * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 Wisp2WaitNotifyTest + * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestWisp2WaitNotify */ import com.alibaba.wisp.engine.WispEngine; @@ -12,7 +12,7 @@ import static jdk.test.lib.Asserts.assertEQ; -public class Wisp2WaitNotifyTest { +public class TestWisp2WaitNotify { private AtomicInteger seq = new AtomicInteger(); private int finishCnt = 0; @@ -20,7 +20,7 @@ public class Wisp2WaitNotifyTest { private boolean fooCond = false; public static void main(String[] args) throws Exception { - Wisp2WaitNotifyTest s = new Wisp2WaitNotifyTest(); + TestWisp2WaitNotify s = new TestWisp2WaitNotify(); synchronized (s) { WispEngine.dispatch(s::foo); assertEQ(s.seq.getAndIncrement(), 0); diff --git a/test/jdk/com/alibaba/wisp2/Wisp2WorkStealTest.java b/test/jdk/com/alibaba/wisp2/TestWisp2WorkSteal.java similarity index 93% rename from test/jdk/com/alibaba/wisp2/Wisp2WorkStealTest.java rename to test/jdk/com/alibaba/wisp2/TestWisp2WorkSteal.java index b52f19d66b3..ab4844e5776 100644 --- a/test/jdk/com/alibaba/wisp2/Wisp2WorkStealTest.java +++ b/test/jdk/com/alibaba/wisp2/TestWisp2WorkSteal.java @@ -3,10 +3,10 @@ * @library /test/lib * @summary verification of work stealing really happened, also test the several WorkStealCandidates of Wisp2 in different mode: interp/c1/c2 * @modules java.base/jdk.internal.access - * @run main/othervm -XX:+UseWisp2 -Dcom.alibaba.wisp.schedule.stealRetry=100 Wisp2WorkStealTest - * @run main/othervm -XX:+UseWisp2 -Dcom.alibaba.wisp.schedule.stealRetry=100 -Xcomp -client Wisp2WorkStealTest - * @run main/othervm -XX:+UseWisp2 -Dcom.alibaba.wisp.schedule.stealRetry=100 -Xcomp -server Wisp2WorkStealTest - * @run main/othervm -XX:+UseWisp2 -Dcom.alibaba.wisp.schedule.stealRetry=100 -Xint Wisp2WorkStealTest + * @run main/othervm -XX:+UseWisp2 -Dcom.alibaba.wisp.schedule.stealRetry=100 TestWisp2WorkSteal + * @run main/othervm -XX:+UseWisp2 -Dcom.alibaba.wisp.schedule.stealRetry=100 -Xcomp -client TestWisp2WorkSteal + * @run main/othervm -XX:+UseWisp2 -Dcom.alibaba.wisp.schedule.stealRetry=100 -Xcomp -server TestWisp2WorkSteal + * @run main/othervm -XX:+UseWisp2 -Dcom.alibaba.wisp.schedule.stealRetry=100 -Xint TestWisp2WorkSteal */ import com.alibaba.wisp.engine.WispEngine; @@ -21,7 +21,7 @@ import static jdk.test.lib.Asserts.assertNE; -public class Wisp2WorkStealTest { +public class TestWisp2WorkSteal { // We have several WispStealCandidates in coroutine.hpp: // in `class WispStealCandidate`: @@ -45,7 +45,7 @@ private static void goNatives(Object lock) { private static class Dummy { public Dummy(Object lock) { try { - Method m = Wisp2WorkStealTest.class.getDeclaredMethod("goNatives", Object.class); + Method m = TestWisp2WorkSteal.class.getDeclaredMethod("goNatives", Object.class); m.invoke(null, lock); // 3. Method.invoke() test } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { e.printStackTrace(); diff --git a/test/jdk/com/alibaba/wisp2/WispInitShutdownTest.java b/test/jdk/com/alibaba/wisp2/TestWispInitShutdown.java similarity index 90% rename from test/jdk/com/alibaba/wisp2/WispInitShutdownTest.java rename to test/jdk/com/alibaba/wisp2/TestWispInitShutdown.java index 4d451f383eb..771cc613b4f 100644 --- a/test/jdk/com/alibaba/wisp2/WispInitShutdownTest.java +++ b/test/jdk/com/alibaba/wisp2/TestWispInitShutdown.java @@ -1,8 +1,8 @@ /* * @test - * @summary WispInitShutdownTest + * @summary TestWispInitShutdown * @library /test/lib - * @run main/othervm -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 WispInitShutdownTest + * @run main/othervm -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 TestWispInitShutdown */ import com.alibaba.wisp.engine.WispEngine; @@ -13,7 +13,7 @@ import static jdk.test.lib.Asserts.assertTrue; -public class WispInitShutdownTest { +public class TestWispInitShutdown { public static CountDownLatch shutddownLatch = new CountDownLatch(1); public static AtomicBoolean suc = new AtomicBoolean(false); @@ -48,7 +48,7 @@ public void run() { class SomeC { static { try { - WispInitShutdownTest.shutddownLatch.await(); + TestWispInitShutdown.shutddownLatch.await(); for (int i = 0; i < 10; i++) { Thread.sleep(40); } @@ -56,4 +56,4 @@ class SomeC { e.printStackTrace(); } } -} \ No newline at end of file +} diff --git a/test/jdk/com/alibaba/wisp2/bug/ConcurrentThreadJoinTest.java b/test/jdk/com/alibaba/wisp2/bug/TestConcurrentThreadJoin.java similarity index 83% rename from test/jdk/com/alibaba/wisp2/bug/ConcurrentThreadJoinTest.java rename to test/jdk/com/alibaba/wisp2/bug/TestConcurrentThreadJoin.java index 4cdfb9dd1fb..9c3c9a1a6ac 100644 --- a/test/jdk/com/alibaba/wisp2/bug/ConcurrentThreadJoinTest.java +++ b/test/jdk/com/alibaba/wisp2/bug/TestConcurrentThreadJoin.java @@ -2,12 +2,12 @@ * @test * @library /test/lib * @summary ensure thread.isAlive() is false after thread.join() - * @run main/othervm -XX:+UseWisp2 ConcurrentThreadJoinTest + * @run main/othervm -XX:+UseWisp2 TestConcurrentThreadJoin */ import static jdk.test.lib.Asserts.assertFalse; -public class ConcurrentThreadJoinTest { +public class TestConcurrentThreadJoin { public static void main(String[] args) throws Exception { long start = System.currentTimeMillis(); diff --git a/test/jdk/com/alibaba/wisp2/bug/DisableStealBugTest.java b/test/jdk/com/alibaba/wisp2/bug/TestDisableStealBug.java similarity index 95% rename from test/jdk/com/alibaba/wisp2/bug/DisableStealBugTest.java rename to test/jdk/com/alibaba/wisp2/bug/TestDisableStealBug.java index 8a7251f4222..fdb573180d6 100644 --- a/test/jdk/com/alibaba/wisp2/bug/DisableStealBugTest.java +++ b/test/jdk/com/alibaba/wisp2/bug/TestDisableStealBug.java @@ -4,7 +4,7 @@ * @modules java.base/jdk.internal.access * @modules java.base/com.alibaba.wisp.engine:+open * @summary test bug of update stealEnable fail - * @run main/othervm -XX:+UseWisp2 DisableStealBugTest + * @run main/othervm -XX:+UseWisp2 TestDisableStealBug */ import com.alibaba.wisp.engine.WispEngine; @@ -16,7 +16,7 @@ import static jdk.test.lib.Asserts.assertTrue; -public class DisableStealBugTest { +public class TestDisableStealBug { public static void main(String[] args) throws Exception { AtomicReference task = new AtomicReference<>(); diff --git a/test/jdk/com/alibaba/wisp2/bug/EpollWakeupTest.java b/test/jdk/com/alibaba/wisp2/bug/TestEpollWakeup.java similarity index 96% rename from test/jdk/com/alibaba/wisp2/bug/EpollWakeupTest.java rename to test/jdk/com/alibaba/wisp2/bug/TestEpollWakeup.java index 4e46564b219..df12e47cafb 100644 --- a/test/jdk/com/alibaba/wisp2/bug/EpollWakeupTest.java +++ b/test/jdk/com/alibaba/wisp2/bug/TestEpollWakeup.java @@ -2,7 +2,7 @@ * @test * @library /test/lib * @summary test selector.wakeup() dispatched - * @run main/othervm -XX:+UseWisp2 EpollWakeupTest 3000 + * @run main/othervm -XX:+UseWisp2 TestEpollWakeup 3000 */ import java.nio.channels.Selector; @@ -18,7 +18,7 @@ * Sleep random us before wakeup/select, * To help us coverage all branches, including pre-wakeup, normal-wakeup, concurrent-wakeup */ -public class EpollWakeupTest { +public class TestEpollWakeup { public static void main(String[] args) throws Exception { Selector selector = Selector.open(); CyclicBarrier barrier = new CyclicBarrier(2); diff --git a/test/jdk/com/alibaba/wisp2/bug/IsInNativeTest.java b/test/jdk/com/alibaba/wisp2/bug/TestIsInNative.java similarity index 94% rename from test/jdk/com/alibaba/wisp2/bug/IsInNativeTest.java rename to test/jdk/com/alibaba/wisp2/bug/TestIsInNative.java index d36ff4965fb..a073e1ad1f4 100644 --- a/test/jdk/com/alibaba/wisp2/bug/IsInNativeTest.java +++ b/test/jdk/com/alibaba/wisp2/bug/TestIsInNative.java @@ -3,7 +3,7 @@ * @library /test/lib * @summary test Thread.isInNative() is correct * @modules java.base/jdk.internal.access - * @run main/othervm -XX:+EnableCoroutine IsInNativeTest + * @run main/othervm -XX:+EnableCoroutine TestIsInNative */ import jdk.internal.access.SharedSecrets; @@ -16,7 +16,7 @@ import static jdk.test.lib.Asserts.assertFalse; import static jdk.test.lib.Asserts.assertTrue; -public class IsInNativeTest { +public class TestIsInNative { public static void main(String[] args) throws Exception { Thread nthread = new Thread(() -> { try { diff --git a/test/jdk/com/alibaba/wisp2/bug/PreemptWispInternalBugTest.java b/test/jdk/com/alibaba/wisp2/bug/TestPreemptWispInternalBug.java similarity index 90% rename from test/jdk/com/alibaba/wisp2/bug/PreemptWispInternalBugTest.java rename to test/jdk/com/alibaba/wisp2/bug/TestPreemptWispInternalBug.java index 75899ad1252..17d5f612518 100644 --- a/test/jdk/com/alibaba/wisp2/bug/PreemptWispInternalBugTest.java +++ b/test/jdk/com/alibaba/wisp2/bug/TestPreemptWispInternalBug.java @@ -3,7 +3,7 @@ * @summary Verify wisp internal logic can not be preempted * @modules java.base/jdk.internal.access * @library /test/lib - * @run main PreemptWispInternalBugTest + * @run main TestPreemptWispInternalBug */ import com.alibaba.wisp.engine.WispEngine; @@ -13,14 +13,14 @@ import java.util.concurrent.FutureTask; -public class PreemptWispInternalBugTest { +public class TestPreemptWispInternalBug { public static void main(String[] args) throws Exception { if (args.length == 0) { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( "-XX:+UseWisp2", "-XX:+UnlockDiagnosticVMOptions", "-XX:+VerboseWisp", "-XX:-Inline", "--add-exports=java.base/jdk.internal.access=ALL-UNNAMED", - PreemptWispInternalBugTest.class.getName(), "1"); + TestPreemptWispInternalBug.class.getName(), "1"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("[WISP] preempt was blocked, because wisp internal method on the stack"); return; diff --git a/test/jdk/com/alibaba/wisp2/bug/SchedulerQLBugTest.java b/test/jdk/com/alibaba/wisp2/bug/TestSchedulerQLBug.java similarity index 91% rename from test/jdk/com/alibaba/wisp2/bug/SchedulerQLBugTest.java rename to test/jdk/com/alibaba/wisp2/bug/TestSchedulerQLBug.java index 293df4e7e33..d0e4660b508 100644 --- a/test/jdk/com/alibaba/wisp2/bug/SchedulerQLBugTest.java +++ b/test/jdk/com/alibaba/wisp2/bug/TestSchedulerQLBug.java @@ -4,7 +4,7 @@ * @summary verify queue length not growth infinity * @modules java.base/jdk.internal.access * @modules java.base/com.alibaba.wisp.engine:+open - * @run main/othervm -XX:+UseWisp2 DisableStealBugTest + * @run main/othervm -XX:+UseWisp2 TestDisableStealBug */ import com.alibaba.wisp.engine.Wisp2Group; @@ -16,12 +16,12 @@ import static jdk.test.lib.Asserts.assertLT; -public class SchedulerQLBugTest { +public class TestSchedulerQLBug { public static void main(String[] args) throws Exception { Wisp2Group wisp2Group = Wisp2Group.createGroup(2, Thread::new); CountDownLatch latch = new CountDownLatch(1); wisp2Group.execute(() -> { - DisableStealBugTest.setOrGetStealEnable(SharedSecrets.getWispEngineAccess().getCurrentTask(), true, false); + TestDisableStealBug.setOrGetStealEnable(SharedSecrets.getWispEngineAccess().getCurrentTask(), true, false); latch.countDown(); while (true) { try { diff --git a/test/jdk/com/alibaba/wisp2/bug/Wisp2ThreadObjLeakInThreadGroupTest.java b/test/jdk/com/alibaba/wisp2/bug/TestWisp2ThreadObjLeakInThreadGroup.java similarity index 82% rename from test/jdk/com/alibaba/wisp2/bug/Wisp2ThreadObjLeakInThreadGroupTest.java rename to test/jdk/com/alibaba/wisp2/bug/TestWisp2ThreadObjLeakInThreadGroup.java index 05646d161c8..d254084b9a6 100644 --- a/test/jdk/com/alibaba/wisp2/bug/Wisp2ThreadObjLeakInThreadGroupTest.java +++ b/test/jdk/com/alibaba/wisp2/bug/TestWisp2ThreadObjLeakInThreadGroup.java @@ -2,14 +2,14 @@ * @test * @library /test/lib * @summary test bug fix of thread object leak in thread group - * @run main/othervm -XX:+UseWisp2 Wisp2ThreadObjLeakInThreadGroupTest + * @run main/othervm -XX:+UseWisp2 TestWisp2ThreadObjLeakInThreadGroup */ import java.util.concurrent.CountDownLatch; import static jdk.test.lib.Asserts.assertEQ; -public class Wisp2ThreadObjLeakInThreadGroupTest { +public class TestWisp2ThreadObjLeakInThreadGroup { public static void main(String[] args) throws Exception { ThreadGroup tg = Thread.currentThread().getThreadGroup(); int count = tg.activeCount(); @@ -21,7 +21,7 @@ public static void main(String[] args) throws Exception { } catch (InterruptedException e) { e.printStackTrace(); } - }, Wisp2ThreadObjLeakInThreadGroupTest.class.getSimpleName()); + }, TestWisp2ThreadObjLeakInThreadGroup.class.getSimpleName()); thread.start(); c1.await(); // wait start assertEQ(tg.activeCount(), count + 1); diff --git a/test/jdk/com/alibaba/wisp2/yield/Wisp2YieldTest.java b/test/jdk/com/alibaba/wisp2/yield/TestWisp2Yield.java similarity index 95% rename from test/jdk/com/alibaba/wisp2/yield/Wisp2YieldTest.java rename to test/jdk/com/alibaba/wisp2/yield/TestWisp2Yield.java index eb05604e7be..04bfa05775d 100644 --- a/test/jdk/com/alibaba/wisp2/yield/Wisp2YieldTest.java +++ b/test/jdk/com/alibaba/wisp2/yield/TestWisp2Yield.java @@ -2,7 +2,7 @@ * @test * @library /test/lib * @summary Test yield in wisp2 - * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 -Dcom.alibaba.wisp.workerEngines=1 Wisp2YieldTest + * @run main/othervm -XX:-UseBiasedLocking -XX:+EnableCoroutine -XX:+UseWispMonitor -Dcom.alibaba.wisp.transparentWispSwitch=true -Dcom.alibaba.wisp.version=2 -Dcom.alibaba.wisp.workerEngines=1 TestWisp2Yield */ import com.alibaba.wisp.engine.WispEngine; @@ -10,7 +10,7 @@ import static jdk.test.lib.Asserts.assertTrue; -public class Wisp2YieldTest { +public class TestWisp2Yield { public static void main(String[] args) { boolean success[] = new boolean[1]; WispEngine.dispatch(() -> { diff --git a/test/jdk/com/alibaba/wisp2/yield/YieldEmptyQueueTest.java b/test/jdk/com/alibaba/wisp2/yield/TestYieldEmptyQueue.java similarity index 93% rename from test/jdk/com/alibaba/wisp2/yield/YieldEmptyQueueTest.java rename to test/jdk/com/alibaba/wisp2/yield/TestYieldEmptyQueue.java index 79e0ef9b26d..fa38a5d7827 100644 --- a/test/jdk/com/alibaba/wisp2/yield/YieldEmptyQueueTest.java +++ b/test/jdk/com/alibaba/wisp2/yield/TestYieldEmptyQueue.java @@ -3,7 +3,7 @@ * @library /test/lib * @modules java.base/com.alibaba.wisp.engine:+open * @summary Verify yield not really happened when queue is empty - * @run main/othervm -XX:+UseWisp2 YieldEmptyQueueTest + * @run main/othervm -XX:+UseWisp2 TestYieldEmptyQueue */ import com.alibaba.wisp.engine.WispEngine; @@ -13,7 +13,7 @@ import static jdk.test.lib.Asserts.assertTrue; -public class YieldEmptyQueueTest { +public class TestYieldEmptyQueue { public static void main(String[] args) throws Exception { assertTrue(Executors.newSingleThreadExecutor().submit(() -> { long sc = (long) new ObjAccess(WispEngine.current()).ref("counter").ref("switchCount").obj; diff --git a/test/jdk/com/alibaba/wisp2/yield/YieldFewNanosTest.java b/test/jdk/com/alibaba/wisp2/yield/TestYieldFewNanos.java similarity index 75% rename from test/jdk/com/alibaba/wisp2/yield/YieldFewNanosTest.java rename to test/jdk/com/alibaba/wisp2/yield/TestYieldFewNanos.java index 6d6cfa69512..51ade3e93a9 100644 --- a/test/jdk/com/alibaba/wisp2/yield/YieldFewNanosTest.java +++ b/test/jdk/com/alibaba/wisp2/yield/TestYieldFewNanos.java @@ -3,7 +3,7 @@ * @library /test/lib * @summary Verify park not happened for a very small interval * @modules java.base/com.alibaba.wisp.engine:+open - * @run main/othervm -XX:+UseWisp2 YieldFewNanosTest + * @run main/othervm -XX:+UseWisp2 TestYieldFewNanos */ import com.alibaba.wisp.engine.WispEngine; @@ -13,12 +13,12 @@ import static jdk.test.lib.Asserts.assertTrue; -public class YieldFewNanosTest { +public class TestYieldFewNanos { public static void main(String[] args) throws Exception { assertTrue(Executors.newSingleThreadExecutor().submit(() -> { - long pc = (long) new YieldEmptyQueueTest.ObjAccess(WispEngine.current()).ref("counter").ref("parkCount").obj; + long pc = (long) new TestYieldEmptyQueue.ObjAccess(WispEngine.current()).ref("counter").ref("parkCount").obj; LockSupport.parkNanos(1); - return (long) new YieldEmptyQueueTest.ObjAccess(WispEngine.current()).ref("counter").ref("parkCount").obj == pc; + return (long) new TestYieldEmptyQueue.ObjAccess(WispEngine.current()).ref("counter").ref("parkCount").obj == pc; }).get()); } } diff --git a/test/jdk/com/alibaba/wisp2/yield/YieldTimerTest.java b/test/jdk/com/alibaba/wisp2/yield/TestYieldTimer.java similarity index 93% rename from test/jdk/com/alibaba/wisp2/yield/YieldTimerTest.java rename to test/jdk/com/alibaba/wisp2/yield/TestYieldTimer.java index 788f6bfb823..f57101c6edc 100644 --- a/test/jdk/com/alibaba/wisp2/yield/YieldTimerTest.java +++ b/test/jdk/com/alibaba/wisp2/yield/TestYieldTimer.java @@ -3,7 +3,7 @@ * @library /test/lib * @summary Verify timer could be processed when we're yielding * @modules java.base/com.alibaba.wisp.engine:+open - * @run main/othervm -XX:+UseWisp2 -Dcom.alibaba.wisp.carrierEngines=1 YieldTimerTest + * @run main/othervm -XX:+UseWisp2 -Dcom.alibaba.wisp.carrierEngines=1 TestYieldTimer */ @@ -11,7 +11,7 @@ import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; -public class YieldTimerTest { +public class TestYieldTimer { public static void main(String[] args) throws Exception { Future future = Executors.newSingleThreadExecutor().submit(() -> { try {