RFR: 8272600: (test) Use native "sleep" in Basic.java [v3]
David Holmes
dholmes at openjdk.java.net
Tue Aug 31 01:29:31 UTC 2021
On Sat, 28 Aug 2021 02:34:48 GMT, Roger Riggs <rriggs at openjdk.org> wrote:
>> The intermittent test in java/lang/ProcessBuilder/Basic.java has identified unexpected messages from a child Java VM
>> as the cause of the test failure. Attempts to control the output of the child VM have failed, the VM is unrepentant .
>>
>> There is no functionality in the child except to wait long enough for the test to finish and the child is destroyed.
>> The fix is to switch from using a Java child to using a native child; a new executable `sleepmillis`.
>
> Roger Riggs has updated the pull request incrementally with one additional commit since the last revision:
>
> Revised to use native /bin/sleep program on Unix* (non-Windows).
> For Windows, a native "BasicSleep" program is used.
Hi Roger,
I think this can be simplified - see comments.
Thanks,
David
test/jdk/java/lang/ProcessBuilder/Basic.java line 2646:
> 2644: if (exePath.toFile().canExecute()) {
> 2645: return exePath;
> 2646: }
Not sure why this is so elaborate when elsewhere in the test we just assume `/usr/bin/env` exists?
test/jdk/java/lang/ProcessBuilder/Basic.java line 2662:
> 2660: // Fallback to the JavaChild sleep does a sleep for 10 minutes.
> 2661: // The fallback the Java$Child is used if the test is run without building
> 2662: // the BasicSleep native executable (for Windows).
The comment doesn't read correctly.
test/jdk/java/lang/ProcessBuilder/Basic.java line 2665:
> 2663:
> 2664: Path exePath = Path.of(TEST_NATIVEPATH).resolve("BasicSleep.exe");
> 2665: System.out.println("exePath: " + exePath + ", canExec: " + exePath.toFile().canExecute());
What is this for??
-------------
Changes requested by dholmes (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/5239
More information about the core-libs-dev
mailing list