RFR: 8272600: (test) Use native "sleep" in Basic.java [v3]
David Holmes
dholmes at openjdk.java.net
Tue Aug 31 01:29:32 UTC 2021
On Tue, 24 Aug 2021 19:06:55 GMT, Roger Riggs <rriggs at openjdk.org> wrote:
>> test/jdk/java/lang/ProcessBuilder/Basic.java line 30:
>>
>>> 28: * 6464154 6523983 6206031 4960438 6631352 6631966 6850957 6850958
>>> 29: * 4947220 7018606 7034570 4244896 5049299 8003488 8054494 8058464
>>> 30: * 8067796 8224905 8263729 8265173 8272600 8231297
>>
>> The test should also be modified to use `@run main/othervm/native/timeout=300` so that this test will be flagged by jtreg if `-nativepath:` is not specified.
>
> It should be possible to run this test as a main, without the overhead of building the native image.
> The use of a Java child greatly reduces the complexity of the test and improves its maintainability.
> Requiring a native special built program raises the overhead considerably.
> And all because the VM can't or won't allow its output to be managed.
In the same way the test uses:
` private static final String[] winEnvCommand = {"cmd.exe", "/c", "set"};`
you could also have:
` private static final String[] winSleepCommand = {"cmd.exe", "/c", "timeout", "/T", "60", "/NOBREAK"};`
-------------
PR: https://git.openjdk.java.net/jdk/pull/5239
More information about the core-libs-dev
mailing list