When running jtreg with -vmoptions, those options are not present in the verbose output from jtreg. This makes it hard to see which VM flags were actually used when running a test.
Below is an example.
/*
* @test
* @run main/othervm TestTest
*/
public class TestTest {
public static void main(String... args) throws Exception {
throw new Exception();
}
}
$ jtreg -nr -va -vmoption:-XX:+PrintGC TestTest.java
--------------------------------------------------
TEST: TestTest.java
JDK under test: (/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home)
java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b12)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)
ACTION: build -- Passed. All files up to date
REASON: Named class compiled on demand
TIME: 0.001 seconds
messages:
command: build TestTest
reason: Named class compiled on demand
elapsed time (seconds): 0.001
ACTION: main -- Failed. Execution failed: `main' threw exception: java.lang.Exception
REASON: User specified action: run main/othervm TestTest
TIME: 0.255 seconds
messages:
command: main TestTest
reason: User specified action: run main/othervm TestTest
elapsed time (seconds): 0.255
STDOUT:
STDERR:
java.lang.Exception
at TestTest.main(TestTest.java:7)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:94)
at java.lang.Thread.run(Thread.java:722)
JavaTest Message: Test threw exception: java.lang.Exception
JavaTest Message: shutting down test
STATUS:Failed.`main' threw exception: java.lang.Exception
TEST RESULT: Failed. Execution failed: `main' threw exception: java.lang.Exception
--------------------------------------------------
Test results: failed: 1
Results written to /Users/staffan/mercurial/hotspot-rt-jdk/jdk/test/JTwork
Below is an example.
/*
* @test
* @run main/othervm TestTest
*/
public class TestTest {
public static void main(String... args) throws Exception {
throw new Exception();
}
}
$ jtreg -nr -va -vmoption:-XX:+PrintGC TestTest.java
--------------------------------------------------
TEST: TestTest.java
JDK under test: (/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home)
java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b12)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)
ACTION: build -- Passed. All files up to date
REASON: Named class compiled on demand
TIME: 0.001 seconds
messages:
command: build TestTest
reason: Named class compiled on demand
elapsed time (seconds): 0.001
ACTION: main -- Failed. Execution failed: `main' threw exception: java.lang.Exception
REASON: User specified action: run main/othervm TestTest
TIME: 0.255 seconds
messages:
command: main TestTest
reason: User specified action: run main/othervm TestTest
elapsed time (seconds): 0.255
STDOUT:
STDERR:
java.lang.Exception
at TestTest.main(TestTest.java:7)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:94)
at java.lang.Thread.run(Thread.java:722)
JavaTest Message: Test threw exception: java.lang.Exception
JavaTest Message: shutting down test
STATUS:Failed.`main' threw exception: java.lang.Exception
TEST RESULT: Failed. Execution failed: `main' threw exception: java.lang.Exception
--------------------------------------------------
Test results: failed: 1
Results written to /Users/staffan/mercurial/hotspot-rt-jdk/jdk/test/JTwork
- duplicates
-
CODETOOLS-7900203 JTreg needs to log instructions for rerunning test outside jtreg
-
- Resolved
-