Skip to content

Commit

Permalink
[Runtime] CRaC: add @requires for testcases
Browse files Browse the repository at this point in the history
Summary: Avoid run failed on unsupported platforms.

Testing: All CRaC testcases.

Reviewers: Accelerator1996, sendaoYan

Issue: #887
  • Loading branch information
lingjun-cg committed Nov 6, 2024
1 parent d6ae014 commit a842dbe
Show file tree
Hide file tree
Showing 31 changed files with 60 additions and 1 deletion.
2 changes: 2 additions & 0 deletions test/jdk/jdk/crac/AppendAppClassLoaderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/jdk/jdk/crac/AppendOnlyFileTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions test/jdk/jdk/crac/DryRunTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/jdk/jdk/crac/LazyProps.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/jdk/jdk/crac/LeaveRunning.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/jdk/jdk/crac/MXBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/jdk/jdk/crac/MinimizeLoadedClass.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/jdk/jdk/crac/PseudoPersistentFileTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/jdk/jdk/crac/RefQueueTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/jdk/jdk/crac/RestoreEnvironmentTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/jdk/jdk/crac/RestorePipeFdTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/jdk/jdk/crac/SecureRandom/InterlockTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/jdk/jdk/crac/SecureRandom/ReseedTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/jdk/jdk/crac/Selector/Test970/Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/jdk/jdk/crac/Selector/interruptedSelection/Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/jdk/jdk/crac/Selector/keyAfterRestore/Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/jdk/jdk/crac/Selector/multipleSelect/Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/jdk/jdk/crac/Selector/multipleSelectNow/Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/jdk/jdk/crac/Selector/selectAfterWakeup/Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/jdk/jdk/crac/Selector/wakeupAfterRestore/Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/jdk/jdk/crac/Selector/wakeupByClose/Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions test/jdk/jdk/crac/java/net/InetAddress/ResolveTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/jdk/jdk/crac/recursiveCheckpoint/Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/jdk/jdk/crac/stdoutInDocker/TestStdoutInDocker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit a842dbe

Please sign in to comment.