RFR: 8353190: Use "/native" Run Option for TestAvailableProcessors Execution [v2]
David Holmes
dholmes at openjdk.org
Wed Apr 23 06:36:50 UTC 2025
On Tue, 22 Apr 2025 19:44:43 GMT, Oleksii Sylichenko <duke at openjdk.org> wrote:
>> I discovered that the PATH is only updated when `othervm` and `native` appear together.
>
> - The `TestNGAction` class inherits from the `MainAction` class.
>
> - The run method of `MainAction` checks for the othervm option:
>
>
> case OTHERVM:
> showMode(ExecMode.OTHERVM, othervmOverrideReasons);
> status = runOtherJVM();
> break;
>
>
> https://github.com/openjdk/jtreg/blob/19cdb8404930c3025bd48436907ccc65bd133fee/src/share/classes/com/sun/javatest/regtest/exec/MainAction.java#L350
>
> - The method `MainAction.runOtherJVM()` includes the following line:
>
>
> env.putAll(getEnvVars(nativeCode));
>
>
> https://github.com/openjdk/jtreg/blob/19cdb8404930c3025bd48436907ccc65bd133fee/src/share/classes/com/sun/javatest/regtest/exec/MainAction.java#L415C9-L415C44
>
> - The method `Action.getEnvVars(nativeCode)` modifies the environment variables:
>
>
> String libPath = envVars.get(libPathName);
> if (libPath == null) {
> envVars.put(libPathName, nativeDir.toString());
> } else {
> envVars.put(libPathName, libPath + File.pathSeparator + nativeDir);
> }
>
>
> https://github.com/openjdk/jtreg/blob/19cdb8404930c3025bd48436907ccc65bd133fee/src/share/classes/com/sun/javatest/regtest/exec/Action.java#L158
Thanks for tracking that down. The change looks good, I am just running through our testing to be sure.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23803#discussion_r2055301472
More information about the hotspot-runtime-dev
mailing list