From a842dbe915b616a4951dd3734e8574683c279fa4 Mon Sep 17 00:00:00 2001 From: "lingjun.cg" Date: Wed, 6 Nov 2024 16:02:03 +0800 Subject: [PATCH] [Runtime] CRaC: add @requires for testcases Summary: Avoid run failed on unsupported platforms. Testing: All CRaC testcases. Reviewers: Accelerator1996, sendaoYan Issue: https://github.com/dragonwell-project/dragonwell11/issues/887 --- test/jdk/jdk/crac/AppendAppClassLoaderTest.java | 2 ++ test/jdk/jdk/crac/AppendOnlyFileTest.java | 2 ++ test/jdk/jdk/crac/DryRunTest.java | 2 ++ .../crac/JarFileFactoryCacheTest/JarFileFactoryCacheTest.java | 2 ++ test/jdk/jdk/crac/LazyProps.java | 2 ++ test/jdk/jdk/crac/LeaveRunning.java | 2 ++ test/jdk/jdk/crac/MXBean.java | 2 ++ test/jdk/jdk/crac/MinimizeLoadedClass.java | 2 ++ test/jdk/jdk/crac/PseudoPersistentFileTest.java | 2 ++ test/jdk/jdk/crac/RefQueueTest.java | 2 ++ test/jdk/jdk/crac/RestoreEnvironmentTest.java | 2 ++ test/jdk/jdk/crac/RestorePipeFdTest.java | 2 ++ test/jdk/jdk/crac/SecureRandom/InterlockTest.java | 2 ++ test/jdk/jdk/crac/SecureRandom/ReseedTest.java | 2 ++ test/jdk/jdk/crac/Selector/Test970/Test.java | 2 ++ test/jdk/jdk/crac/Selector/interruptedSelection/Test.java | 2 ++ test/jdk/jdk/crac/Selector/keyAfterRestore/Test.java | 2 ++ test/jdk/jdk/crac/Selector/multipleSelect/Test.java | 2 ++ test/jdk/jdk/crac/Selector/multipleSelectNow/Test.java | 2 ++ test/jdk/jdk/crac/Selector/multipleSelectSingleClose/Test.java | 2 ++ test/jdk/jdk/crac/Selector/selectAfterWakeup/Test.java | 2 ++ .../jdk/jdk/crac/Selector/selectAndWakeupAfterRestore/Test.java | 2 ++ test/jdk/jdk/crac/Selector/wakeupAfterRestore/Test.java | 2 ++ test/jdk/jdk/crac/Selector/wakeupByClose/Test.java | 2 ++ .../jdk/jdk/crac/Selector/wakeupByTimeoutAfterRestore/Test.java | 2 ++ .../jdk/jdk/crac/fileDescriptors/CheckpointWithOpenFdsTest.java | 2 ++ .../jdk/crac/fileDescriptors/IgnoredFileDescriptorsTest.java | 2 ++ .../jdk/crac/java/lang/Thread/JoinSleepWaitOnCRPauseTest.java | 1 + test/jdk/jdk/crac/java/net/InetAddress/ResolveTest.java | 2 ++ test/jdk/jdk/crac/recursiveCheckpoint/Test.java | 2 ++ test/jdk/jdk/crac/stdoutInDocker/TestStdoutInDocker.sh | 2 +- 31 files changed, 60 insertions(+), 1 deletion(-) diff --git a/test/jdk/jdk/crac/AppendAppClassLoaderTest.java b/test/jdk/jdk/crac/AppendAppClassLoaderTest.java index 94800bcdc8d..bbd727bf762 100644 --- a/test/jdk/jdk/crac/AppendAppClassLoaderTest.java +++ b/test/jdk/jdk/crac/AppendAppClassLoaderTest.java @@ -33,6 +33,8 @@ /** * @test + * @requires (os.family == "linux") + * @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" * @summary Append to app classloader when restore. * @library /test/lib * @compile ./Foo.java diff --git a/test/jdk/jdk/crac/AppendOnlyFileTest.java b/test/jdk/jdk/crac/AppendOnlyFileTest.java index 17500d2cb8e..9aa778c08e4 100644 --- a/test/jdk/jdk/crac/AppendOnlyFileTest.java +++ b/test/jdk/jdk/crac/AppendOnlyFileTest.java @@ -43,6 +43,8 @@ /** * @test + * @requires (os.family == "linux") + * @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" * @library /test/lib * @build AppendOnlyFileTest * @summary Test C&R when open file with write&append mode that no need closed. diff --git a/test/jdk/jdk/crac/DryRunTest.java b/test/jdk/jdk/crac/DryRunTest.java index 8c04f366448..713834069d8 100644 --- a/test/jdk/jdk/crac/DryRunTest.java +++ b/test/jdk/jdk/crac/DryRunTest.java @@ -32,6 +32,8 @@ /** * @test DryRunTest + * @requires (os.family == "linux") + * @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" * @library /test/lib * @build DryRunTest * @run driver jdk.test.lib.crac.CracTest diff --git a/test/jdk/jdk/crac/JarFileFactoryCacheTest/JarFileFactoryCacheTest.java b/test/jdk/jdk/crac/JarFileFactoryCacheTest/JarFileFactoryCacheTest.java index 8007687e3ff..b384d0bb04e 100644 --- a/test/jdk/jdk/crac/JarFileFactoryCacheTest/JarFileFactoryCacheTest.java +++ b/test/jdk/jdk/crac/JarFileFactoryCacheTest/JarFileFactoryCacheTest.java @@ -34,6 +34,8 @@ /** * @test JarFileFactoryCacheTest + * @requires os.family == "linux" + * @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" * @library /test/lib * @build JarFileFactoryCacheTest * @run driver jdk.test.lib.crac.CracTest diff --git a/test/jdk/jdk/crac/LazyProps.java b/test/jdk/jdk/crac/LazyProps.java index e232a4cdec0..8a025fab77a 100644 --- a/test/jdk/jdk/crac/LazyProps.java +++ b/test/jdk/jdk/crac/LazyProps.java @@ -28,6 +28,8 @@ /** * @test + * @requires (os.family == "linux") + * @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" * @library /test/lib * @build LazyProps * @run driver jdk.test.lib.crac.CracTest diff --git a/test/jdk/jdk/crac/LeaveRunning.java b/test/jdk/jdk/crac/LeaveRunning.java index 0773910da8c..265fe4dcc02 100644 --- a/test/jdk/jdk/crac/LeaveRunning.java +++ b/test/jdk/jdk/crac/LeaveRunning.java @@ -32,6 +32,8 @@ /** * @test + * @requires (os.family == "linux") + * @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" * @library /test/lib * @build LeaveRunning * @run driver jdk.test.lib.crac.CracTest diff --git a/test/jdk/jdk/crac/MXBean.java b/test/jdk/jdk/crac/MXBean.java index 336e3eecd12..e8ddee26aff 100644 --- a/test/jdk/jdk/crac/MXBean.java +++ b/test/jdk/jdk/crac/MXBean.java @@ -39,6 +39,8 @@ /** * @test + * @requires (os.family == "linux") + * @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" * @library /test/lib * @build MXBean * @run driver jdk.test.lib.crac.CracTest diff --git a/test/jdk/jdk/crac/MinimizeLoadedClass.java b/test/jdk/jdk/crac/MinimizeLoadedClass.java index ace205f6d1b..fcfc2070a7b 100644 --- a/test/jdk/jdk/crac/MinimizeLoadedClass.java +++ b/test/jdk/jdk/crac/MinimizeLoadedClass.java @@ -28,6 +28,8 @@ /* * @test + * @requires (os.family == "linux") + * @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" * @summary Test only load 3 classes when crac not enabled. * @library /test/lib * @build TestHello diff --git a/test/jdk/jdk/crac/PseudoPersistentFileTest.java b/test/jdk/jdk/crac/PseudoPersistentFileTest.java index e125b3d2244..7791a327232 100644 --- a/test/jdk/jdk/crac/PseudoPersistentFileTest.java +++ b/test/jdk/jdk/crac/PseudoPersistentFileTest.java @@ -32,6 +32,8 @@ /** * @test + * @requires (os.family == "linux") + * @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" * @library /test/lib * @build PseudoPersistentFileTest * @run driver/timeout=60 jdk.test.lib.crac.CracTest diff --git a/test/jdk/jdk/crac/RefQueueTest.java b/test/jdk/jdk/crac/RefQueueTest.java index 2cee22c2a7a..e57fdc80b63 100644 --- a/test/jdk/jdk/crac/RefQueueTest.java +++ b/test/jdk/jdk/crac/RefQueueTest.java @@ -31,6 +31,8 @@ /** * @test + * @requires (os.family == "linux") + * @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" * @library /test/lib * @build RefQueueTest * @run driver jdk.test.lib.crac.CracTest diff --git a/test/jdk/jdk/crac/RestoreEnvironmentTest.java b/test/jdk/jdk/crac/RestoreEnvironmentTest.java index 72d1eddb87c..2c08a0241b6 100644 --- a/test/jdk/jdk/crac/RestoreEnvironmentTest.java +++ b/test/jdk/jdk/crac/RestoreEnvironmentTest.java @@ -29,6 +29,8 @@ /* * @test RestoreEnvironmentTest + * @requires (os.family == "linux") + * @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" * @summary the test checks that actual environment variables are propagated into a restored process. * @library /test/lib * @build RestoreEnvironmentTest diff --git a/test/jdk/jdk/crac/RestorePipeFdTest.java b/test/jdk/jdk/crac/RestorePipeFdTest.java index 49e720d7157..858f1db22a1 100644 --- a/test/jdk/jdk/crac/RestorePipeFdTest.java +++ b/test/jdk/jdk/crac/RestorePipeFdTest.java @@ -28,6 +28,8 @@ /** * @test + * @requires (os.family == "linux") + * @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" * @summary test if pipe can restore * @library /test/lib * @build RestorePipeFdTest diff --git a/test/jdk/jdk/crac/SecureRandom/InterlockTest.java b/test/jdk/jdk/crac/SecureRandom/InterlockTest.java index fd87f6e3e8c..e6b8ec1fe33 100644 --- a/test/jdk/jdk/crac/SecureRandom/InterlockTest.java +++ b/test/jdk/jdk/crac/SecureRandom/InterlockTest.java @@ -28,6 +28,8 @@ /* * @test + * @requires (os.family == "linux") + * @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" * @summary Verify that secure random is not interlocked during checkpoint/restore. * @library /test/lib * @build InterlockTest diff --git a/test/jdk/jdk/crac/SecureRandom/ReseedTest.java b/test/jdk/jdk/crac/SecureRandom/ReseedTest.java index 7ef34ee8666..6f84ca3bb28 100644 --- a/test/jdk/jdk/crac/SecureRandom/ReseedTest.java +++ b/test/jdk/jdk/crac/SecureRandom/ReseedTest.java @@ -31,6 +31,8 @@ /* * @test + * @requires (os.family == "linux") + * @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" * @summary Verify that SHA1PRNG secure random is reseeded after restore if initialized with default seed. * @library /test/lib * @build ReseedTest diff --git a/test/jdk/jdk/crac/Selector/Test970/Test.java b/test/jdk/jdk/crac/Selector/Test970/Test.java index d6946c675c9..ac0b304c219 100644 --- a/test/jdk/jdk/crac/Selector/Test970/Test.java +++ b/test/jdk/jdk/crac/Selector/Test970/Test.java @@ -27,6 +27,8 @@ /* * @test Selector/Test970 + * @requires (os.family == "linux") + * @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" * @summary a regression test for ZE-970 ("a channel deregistration * is locked depending on mutual order of selector and channel creation") * @library /test/lib diff --git a/test/jdk/jdk/crac/Selector/interruptedSelection/Test.java b/test/jdk/jdk/crac/Selector/interruptedSelection/Test.java index 25329409641..58f9a3777dd 100644 --- a/test/jdk/jdk/crac/Selector/interruptedSelection/Test.java +++ b/test/jdk/jdk/crac/Selector/interruptedSelection/Test.java @@ -27,6 +27,8 @@ /* * @test Selector/interruptedSelection + * @requires (os.family == "linux") + * @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" * @summary check that the thread blocked by Selector.select() could be properly woken up by an interruption * @library /test/lib * @build Test diff --git a/test/jdk/jdk/crac/Selector/keyAfterRestore/Test.java b/test/jdk/jdk/crac/Selector/keyAfterRestore/Test.java index 9a01b7af10f..89962365173 100644 --- a/test/jdk/jdk/crac/Selector/keyAfterRestore/Test.java +++ b/test/jdk/jdk/crac/Selector/keyAfterRestore/Test.java @@ -28,6 +28,8 @@ /* * @test Selector/keyAfterRestore + * @requires (os.family == "linux") + * @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" * @summary a trivial test for SelectionKey's state after restore * @library /test/lib * @build ChannelResource diff --git a/test/jdk/jdk/crac/Selector/multipleSelect/Test.java b/test/jdk/jdk/crac/Selector/multipleSelect/Test.java index 17edf35e837..38f4961baa2 100644 --- a/test/jdk/jdk/crac/Selector/multipleSelect/Test.java +++ b/test/jdk/jdk/crac/Selector/multipleSelect/Test.java @@ -30,6 +30,8 @@ /* * @test Selector/multipleSelect + * @requires (os.family == "linux") + * @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" * @summary check work of multiple select() + wakeup() + C/R * @library /test/lib * @build Test diff --git a/test/jdk/jdk/crac/Selector/multipleSelectNow/Test.java b/test/jdk/jdk/crac/Selector/multipleSelectNow/Test.java index 96d2adcd62c..3348df95c67 100644 --- a/test/jdk/jdk/crac/Selector/multipleSelectNow/Test.java +++ b/test/jdk/jdk/crac/Selector/multipleSelectNow/Test.java @@ -29,6 +29,8 @@ /* * @test Selector/multipleSelectNow + * @requires (os.family == "linux") + * @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" * @summary check work of multiple selectNow() + C/R peaceful coexistence * @library /test/lib * @build Test diff --git a/test/jdk/jdk/crac/Selector/multipleSelectSingleClose/Test.java b/test/jdk/jdk/crac/Selector/multipleSelectSingleClose/Test.java index ac9daaa9622..7e0dbeca937 100644 --- a/test/jdk/jdk/crac/Selector/multipleSelectSingleClose/Test.java +++ b/test/jdk/jdk/crac/Selector/multipleSelectSingleClose/Test.java @@ -31,6 +31,8 @@ /* * @test Selector/multipleSelectSingleClose + * @requires (os.family == "linux") + * @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" * @summary check a coexistence of multiple select() + C/R in case when the selector is finally closed * @library /test/lib * @build Test diff --git a/test/jdk/jdk/crac/Selector/selectAfterWakeup/Test.java b/test/jdk/jdk/crac/Selector/selectAfterWakeup/Test.java index 7623b4638d6..b287780ab90 100644 --- a/test/jdk/jdk/crac/Selector/selectAfterWakeup/Test.java +++ b/test/jdk/jdk/crac/Selector/selectAfterWakeup/Test.java @@ -27,6 +27,8 @@ /* * @test Selector/selectAfterWakeup + * @requires (os.family == "linux") + * @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" * @summary check that the Selector's wakeup() makes the subsequent select() call to return immediately * (see also jdk/test/java/nio/channels/Selector/WakeupSpeed.java); * covers ZE-983 diff --git a/test/jdk/jdk/crac/Selector/selectAndWakeupAfterRestore/Test.java b/test/jdk/jdk/crac/Selector/selectAndWakeupAfterRestore/Test.java index d6bac95ae1c..d8b19cd8278 100644 --- a/test/jdk/jdk/crac/Selector/selectAndWakeupAfterRestore/Test.java +++ b/test/jdk/jdk/crac/Selector/selectAndWakeupAfterRestore/Test.java @@ -26,6 +26,8 @@ /* * @test Selector/selectAndWakeupAfterRestore + * @requires (os.family == "linux") + * @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" * @summary a trivial check that Selector.wakeup() after restore behaves as expected * @library /test/lib * @build Test diff --git a/test/jdk/jdk/crac/Selector/wakeupAfterRestore/Test.java b/test/jdk/jdk/crac/Selector/wakeupAfterRestore/Test.java index 730683b153f..b5ae7d6b565 100644 --- a/test/jdk/jdk/crac/Selector/wakeupAfterRestore/Test.java +++ b/test/jdk/jdk/crac/Selector/wakeupAfterRestore/Test.java @@ -27,6 +27,8 @@ /* * @test Selector/wakeupAfterRestore + * @requires (os.family == "linux") + * @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" * @summary check that the thread blocked by Selector.select() on checkpoint could be properly woken up after restore * @library /test/lib * @build Test diff --git a/test/jdk/jdk/crac/Selector/wakeupByClose/Test.java b/test/jdk/jdk/crac/Selector/wakeupByClose/Test.java index 38a755e7d72..402976b5aaa 100644 --- a/test/jdk/jdk/crac/Selector/wakeupByClose/Test.java +++ b/test/jdk/jdk/crac/Selector/wakeupByClose/Test.java @@ -27,6 +27,8 @@ /* * @test Selector/wakeupByClose + * @requires (os.family == "linux") + * @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" * @summary check that the Selector's close() wakes it up after restore * @library /test/lib * @build Test diff --git a/test/jdk/jdk/crac/Selector/wakeupByTimeoutAfterRestore/Test.java b/test/jdk/jdk/crac/Selector/wakeupByTimeoutAfterRestore/Test.java index 5b3d8915f05..8a173b37c7d 100644 --- a/test/jdk/jdk/crac/Selector/wakeupByTimeoutAfterRestore/Test.java +++ b/test/jdk/jdk/crac/Selector/wakeupByTimeoutAfterRestore/Test.java @@ -26,6 +26,8 @@ /* * @test Selector/wakeupByTimeoutAfterRestore + * @requires (os.family == "linux") + * @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" * @summary check that the Selector selected before the checkpoint, * will wake up by timeout after the restore * @library /test/lib diff --git a/test/jdk/jdk/crac/fileDescriptors/CheckpointWithOpenFdsTest.java b/test/jdk/jdk/crac/fileDescriptors/CheckpointWithOpenFdsTest.java index 14634b081e7..b241100f419 100644 --- a/test/jdk/jdk/crac/fileDescriptors/CheckpointWithOpenFdsTest.java +++ b/test/jdk/jdk/crac/fileDescriptors/CheckpointWithOpenFdsTest.java @@ -31,6 +31,8 @@ /** * @test + * @requires os.family == "linux" + * @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" * @library /test/lib * @build CheckpointWithOpenFdsTest * @run driver jdk.test.lib.crac.CracTest diff --git a/test/jdk/jdk/crac/fileDescriptors/IgnoredFileDescriptorsTest.java b/test/jdk/jdk/crac/fileDescriptors/IgnoredFileDescriptorsTest.java index 08b815d7055..51e70a89193 100644 --- a/test/jdk/jdk/crac/fileDescriptors/IgnoredFileDescriptorsTest.java +++ b/test/jdk/jdk/crac/fileDescriptors/IgnoredFileDescriptorsTest.java @@ -38,6 +38,8 @@ /** * @test + * @requires os.family == "linux" + * @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" * @library /test/lib * @build IgnoredFileDescriptorsTest * @run driver jdk.test.lib.crac.CracTest diff --git a/test/jdk/jdk/crac/java/lang/Thread/JoinSleepWaitOnCRPauseTest.java b/test/jdk/jdk/crac/java/lang/Thread/JoinSleepWaitOnCRPauseTest.java index f369f8fb1de..01d0da26de1 100644 --- a/test/jdk/jdk/crac/java/lang/Thread/JoinSleepWaitOnCRPauseTest.java +++ b/test/jdk/jdk/crac/java/lang/Thread/JoinSleepWaitOnCRPauseTest.java @@ -29,6 +29,7 @@ /* * @test JoinSleepWaitOnCRPauseTest.java * @requires (os.family == "linux") + * @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" * @library /test/lib * @summary check if Thread.join(timeout), Thread.sleep(timeout) * and Object.wait(timeout) diff --git a/test/jdk/jdk/crac/java/net/InetAddress/ResolveTest.java b/test/jdk/jdk/crac/java/net/InetAddress/ResolveTest.java index 82d95995972..89f400d8258 100644 --- a/test/jdk/jdk/crac/java/net/InetAddress/ResolveTest.java +++ b/test/jdk/jdk/crac/java/net/InetAddress/ResolveTest.java @@ -38,6 +38,8 @@ /* * @test + * @requires (os.family == "linux") + * @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" * @summary Test if InetAddress cache is flushed after checkpoint/restore * @requires docker.support * @library /test/lib diff --git a/test/jdk/jdk/crac/recursiveCheckpoint/Test.java b/test/jdk/jdk/crac/recursiveCheckpoint/Test.java index 90a3ae00103..3d0957f13c7 100644 --- a/test/jdk/jdk/crac/recursiveCheckpoint/Test.java +++ b/test/jdk/jdk/crac/recursiveCheckpoint/Test.java @@ -25,6 +25,8 @@ /* * @test + * @requires (os.family == "linux") + * @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" * @summary check that the recursive checkpoint is not allowed * @library /test/lib * @build Test diff --git a/test/jdk/jdk/crac/stdoutInDocker/TestStdoutInDocker.sh b/test/jdk/jdk/crac/stdoutInDocker/TestStdoutInDocker.sh index 32ca431f527..81220df07a2 100644 --- a/test/jdk/jdk/crac/stdoutInDocker/TestStdoutInDocker.sh +++ b/test/jdk/jdk/crac/stdoutInDocker/TestStdoutInDocker.sh @@ -28,7 +28,7 @@ # Test docker run with the combination of (privileged/unprivileged) and (interactive/detach) modes. # @requires docker.support # @requires os.family == "linux" -# @requires os.arch=="amd64" | os.arch=="aarch64" +# @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" # @build TestStdoutInDocker # @run shell TestStdoutInDocker.sh