RFR: 8356102: TestJcmdOutput, JcmdWithNMTDisabled and DumpSharedDictionary hs/tier1 tests fail on static-jdk [v2]

Jiangli Zhou jiangli at openjdk.org
Mon May 12 21:59:53 UTC 2025


On Mon, 12 May 2025 04:44:32 GMT, Jiangli Zhou <jiangli at openjdk.org> wrote:

>> Please review the change to set `-Dcompile.jdk=<jdk>` when launching child processes in TestJcmdOutput, JcmdWithNMTDisabled and DumpSharedDictionary hs/tier1 tests.
>> 
>> These three tests fail on static-jdk as `jdk.test.lib.JDKToolFinder.getJDKTool()` fails to locate the `jcmd` tool. `JDKToolFinder.getJDKTool()` locates the requested tool from the path specified in 'test.jdk' system property first, then using the path specified in 'compile.jdk' system property. Currently when running jtreg tests on static-jdk, jtreg '-compilejdk' is set to a regular JDK binary. Populating the 'compile.jdk' system property from jtreg when creating the child process would allow `JDKToolFinder.getJDKTool()` (executing in the child process) to locate the tool from 'compile.jdk' path.
>> 
>> Tested all three tests on static-jdk. All three tests pass with the fix.
>
> Jiangli Zhou has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Address David and Thomas comment:
>   - Set `-Dcompile.jdk= ...` for child process from `ProcessTools.createJavaProcessBuilder()`.
>   - Revert tests.

The jdk/internal/misc/VM/RuntimeArguments.java test fails due the additional command-line option, https://github.com/jianglizhou/jdk/actions/runs/14963966012#user-content-jdk_internal_misc_vm_runtimearguments. Perhaps we can consider changing test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/TestJcmdOutput.java and test/hotspot/jtreg/runtime/NMT/JcmdWithNMTDisabled.java to use `ProcessTools.createTestJavaProcessBuilder` and add the `-Dcompile.jdk=...` for child process created by `ProcessTools.createTestJavaProcessBuilder` only.

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

PR Comment: https://git.openjdk.org/jdk/pull/25018#issuecomment-2874295065


More information about the hotspot-runtime-dev mailing list