RFR: 8353190: Use "/native" Run Option for TestAvailableProcessors Execution [v2]
Oleksii Sylichenko
duke at openjdk.org
Tue Apr 22 19:51:25 UTC 2025
On Tue, 22 Apr 2025 19:33:56 GMT, Oleksii Sylichenko <duke at openjdk.org> wrote:
>> test/hotspot/jtreg/runtime/os/windows/TestAvailableProcessors.java line 34:
>>
>>> 32: * @library /test/lib
>>> 33: * @compile GetAvailableProcessors.java
>>> 34: * @run testng/othervm/native --enable-native-access=ALL-UNNAMED TestAvailableProcessors
>>
>> It is a good catch that this test needs to declare it needs the native image to have been built - though `native` is not listed as a valid sub-option for `testng`.
>>
>> Why do you need the `--enable-native-access` here?
>
> Thank you for your remark. Indeed, you are right — the `--enable-native-access` option is not necessary here. I will remove it.
>
> Although native is not listed as a valid sub-option for testng in the documentation, it is actually supported.
>
> The class for the testng option, `com.sun.javatest.regtest.exec.TestNGAction`, inherits from `com.sun.javatest.regtest.exec.MainAction` and calls its init method, which enables support for the native option.
>
> - TestNG action class:
> https://github.com/openjdk/jtreg/blob/f4f2843c876dc974750eabc8875de08e56bd3852/src/share/classes/com/sun/javatest/regtest/exec/TestNGAction.java#L50
>
> - Call to parent init method:
> https://github.com/openjdk/jtreg/blob/f4f2843c876dc974750eabc8875de08e56bd3852/src/share/classes/com/sun/javatest/regtest/exec/TestNGAction.java#L86
>
> - Parent `MainAction` class checking for the native option:
> https://github.com/openjdk/jtreg/blob/f4f2843c876dc974750eabc8875de08e56bd3852/src/share/classes/com/sun/javatest/regtest/exec/MainAction.java#L145
Removed `--enable-native-access` at 0d002f22fbce32b8e61c5e94881aab0c638d7713
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23803#discussion_r2054755163
More information about the hotspot-runtime-dev
mailing list