[crac] RFR: Convert CRaC tests from shell scripts to Java [v3]

Anton Kozlov akozlov at openjdk.org
Wed Mar 8 14:39:35 UTC 2023


The message from this sender included one or more files
which could not be scanned for virus detection; do not
open these files unless you are certain of the sender's intent.

----------------------------------------------------------------------
On Tue, 7 Mar 2023 14:18:39 GMT, Radim Vansa <duke at openjdk.org> wrote:

>> test/jdk/jdk/crac/java/net/InetAddress/ResolveTest.java line 56:
>> 
>>> 54:  * @run driver jdk.test.lib.crac.CracTest
>>> 55:  */
>>> 56: public class ResolveTest implements CracTest {
>> 
>> Also, that's strange, byt when running tests in batch, I get a problem with docker tests. Apparently CracTest is not copied to the classes dir. When I rerun the test individually, it fails. But if I clean the jtreg workdir and run the test individually, it passes.
>> 
>> 
>> anton at mercury:~/proj/crac$ ~/Downloads/jtreg-6+1/bin/jtreg -nr -jdk:build/linux-x86_64-server-fastdebug/images/jdk/ test/jdk/jdk/crac/
>> Directory "JTwork" not found: creating
>> Test results: passed: 25; failed: 1
>> Results written to /home/anton/proj/crac/JTwork
>> Error: Some tests failed or other problems occurred.
>> 
>> 
>> JTwork/jdk/crac/java/net/InetAddress/ResolveTest.jtr:20:execStatus=Failed. Execution failed: `main' threw 
>> exception: java.util.concurrent.CancellationException
>> 
>> 
>> anton at mercury:~/proj/crac$ ~/Downloads/jtreg-6+1/bin/jtreg -nr -jdk:build/linux-x86_64-server-fastdebug/images/jdk/ test/jdk/jdk/crac/java/net/InetAddress/ResolveTest.java
>> Test results: failed: 1
>> Results written to /home/anton/proj/crac/JTwork
>> Error: Some tests failed or other problems occurred.
>> 
>> 
>> 
>> ----------System.err:(21/1653)----------
>> Starting docker container:
>> docker run --rm -d --privileged --init --volume /home/anton/proj/crac/JTwork/classes/jdk/crac/java/net/InetAddress/ResolveTest.d:/test-classes/ --volume cr:/cr --volume /home/anton/proj/crac/build/linux-x86_64-server-fastdebug/images/jdk/lib/criu:/criu --env CRAC_CRIU_PATH=/criu --name crac-test --add-host some.test.hostname.example.com:192.168.12.34 jdk-internal:test-inet-address sleep 3600
>> Starting process to be checkpointed:
>> docker exec crac-test /jdk/bin/java -ea -cp /test-classes -XX:CRaCCheckpointTo=cr jdk.test.lib.crac.CracTest __run_test__ ResolveTest some.test.hostname.example.com /second-run
>> ERROR: Error: Could not find or load main class jdk.test.lib.crac.CracTest
>> ERROR: Caused by: java.lang.ClassNotFoundException: jdk.test.lib.crac.CracTest
>> java.util.concurrent.CancellationException
>> 	at java.base/java.util.concurrent.CompletableFuture.cancel(CompletableFuture.java:2478)
>> 	at ResolveTest.lambda$test$1(ResolveTest.java:85)
>> 	at jdk.test.lib.crac.CracProcess$1.processLine(CracProcess.java:105)
>> 	at jdk.test.lib.process.StreamPumper.lambda$run$0(StreamPumper.java:127)
>> 	at java.base/java.lang.Iterable.forEach(Iterable.java:75)
>> 	at jdk.test.lib.process.StreamPumper.run(StreamPumper.java:127)
>> 	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
>> 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
>> 	at java.base/java.lang.Thread.run(Thread.java:833)
>> 
>> 
>> 
>> anton at mercury:~/proj/crac$ ls JTwork/classes/jdk/crac/java/net/InetAddress/ResolveTest.d/jdk/test/lib/crac/CracTest.class
>> ls: cannot access 'JTwork/classes/jdk/crac/java/net/InetAddress/ResolveTest.d/jdk/test/lib/crac/CracTest.class': No such file or directory
>> 
>> 
>> anton at mercury:~/proj/crac$ ~/Downloads/jtreg-6+1/bin/jtreg -w:JTwork.resolve -nr -jdk:build/linux-x86_64-server-fastdebug/images/jdk/ test/jdk/jdk/crac/java/net/InetAddress/ResolveTest.java
>> Directory "JTwork.resolve" not found: creating
>> Test results: passed: 1
>> Results written to /home/anton/proj/crac/JTwork.resolve
>
> You might be using an old version of JTReg? I don't have that issue with 7.1.1, so some bugs may have been fixed. Although I must admit that when I was trying to avoid the `@build ResolveTest` in the headers I had similar problems with classes not being compiled.

After switching to jtreg-7.1+1, the did not reproduce. OK, let's assume that was a jtreg problem.

-------------

PR: https://git.openjdk.org/crac/pull/50


More information about the crac-dev mailing list