RFR: 7903030: jtreg should print stdout if JVM gathering properties fails

Igor Ignatyev iignatyev at openjdk.java.net
Fri Oct 15 18:45:18 UTC 2021


On Fri, 15 Oct 2021 17:34:31 GMT, Igor Ignatyev <iignatyev at openjdk.org> wrote:

> Hi all,
> 
> could you please review this patch?
> from JBS:
>> currently, if the JVM, which was created to gather (at-requires) properties, fails for any reason, jtreg prints out "failed to get JDK properties for" message together w/ the exit code. and although jtreg always prints out stderr of this JVM, it might not contain enough information to understand the failure and has caused confusion in past.
> 
> testing: run `jtreg -vmoptions:"-Xmx1g -Xms2g"`:
> 
> Error occurred during initialization of VM
> Initial heap size set to a larger value than the maximum heap size
> failed to get JDK properties for /Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents/Home/bin/java -Xmx1g -Xms2g; exit code 1
> Error: failed to get JDK properties for /Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents/Home/bin/java -Xmx1g -Xms2g; exit code 1
> 
> vs old behavior:
> 
> failed to get JDK properties for /Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents/Home/bin/java -Xmx1g -Xms2g; exit code 1
> Error: failed to get JDK properties for /Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents/Home/bin/java -Xmx1g -Xms2g; exit code 1
> 
> 
> Thanks,
> -- Igor

w/ 2655ca4, we now get the whole command line and the working directory in the output for the ease of debbing:

```Error occurred during initialization of VM
Initial heap size set to a larger value than the maximum heap size
failed to get JDK properties:
cmd: "/Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents/Home/bin/java" -classpath" /Users/iignatye/ws/jtreg/build/images/jtreg/lib/javatest.jar:/Users/iignatye/ws/jtreg/build/images/jtreg/lib/jtreg.jar" -Dtest.vm.opts=-Xmx1g -Xms2g" -Dtest.tool.vm.opts=-J-Xmx1g -J-Xms2g" -Dtest.compiler.opts=" -Dtest.java.opts=" -Dtest.jdk=/Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents/Home" -Dcompile.jdk=/Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents/Home" -Dtest.timeout.factor=1.0" -Dtest.root=/Users/iignatye/ws/jtreg/test/4730538/test" -Xmx1g" -Xms2g" com.sun.javatest.regtest.agent.GetJDKProperties" --system-properties" --modules=boot-layer"
cwd: "/Users/iignatye/ws/jtreg/JTwork/scratch"
exit code: 1
Error: failed to get JDK properties:
cmd: "/Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents/Home/bin/java" -classpath" /Users/iignatye/ws/jtreg/build/images/jtreg/lib/javatest.jar:/Users/iignatye/ws/jtreg/build/images/jtreg/lib/jtreg.jar" -Dtest.vm.opts=-Xmx1g -Xms2g" -Dtest.tool.vm.opts=-J-Xmx1g -J-Xms2g" -Dtest.compiler.opts=" -Dtest.java.opts=" -Dtest.jdk=/Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents/Home" -Dcompile.jdk=/Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents/Home" -Dtest.timeout.factor=1.0" -Dtest.root=/Users/iignatye/ws/jtreg/test/4730538/test" -Xmx1g" -Xms2g" com.sun.javatest.regtest.agent.GetJDKProperties" --system-properties" --modules=boot-layer"
cwd: "/Users/iignatye/ws/jtreg/JTwork/scratch"
exit code: 1

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

PR: https://git.openjdk.java.net/jtreg/pull/28


More information about the jtreg-dev mailing list