RFR: 8272600: (test) Use native "sleep" in Basic.java [v4]

David Holmes dholmes at openjdk.java.net
Wed Sep 15 21:51:02 UTC 2021

On Fri, 3 Sep 2021 14:25:53 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:
>   Revert to using BasicSleep on Windows
>   Added diagnostic output for a test that sometimes fails on Linux when using /bin/sleep.
>   Addressed review comments.

test/jdk/java/lang/ProcessBuilder/Basic.java line 2452:

> 2450: 
> 2451:             if (p.waitFor(10, TimeUnit.MILLISECONDS)) {
> 2452:                 System.out.println("WaitFor didn't wait long enough: " + (System.nanoTime() - start));

Either the condition or the message seems wrong here. If waitFor returns true then the process has exited and we obviously did wait long enough.


PR: https://git.openjdk.java.net/jdk/pull/5239

More information about the core-libs-dev mailing list