RFR 8056143: interrupted java/lang/management/MemoryMXBean/LowMemoryTest.java leaves running process
Staffan Larsen
staffan.larsen at oracle.com
Tue Oct 14 14:14:51 UTC 2014
Looks good!
Thanks,
/Staffan
On 14 okt 2014, at 03:46, Jaroslav Bachorik <jaroslav.bachorik at oracle.com> wrote:
> Please, review the following test change
>
> Issue : https://bugs.openjdk.java.net/browse/JDK-8056143
> Webrev: http://cr.openjdk.java.net/~jbachorik/8056143/webrev.00
>
> The method jdk.testlibrary.ProcessTools.getOutput(process) waits for the given process to finish (process.waitFor()) before grabbing its outputs. However, the code does not handle the process.waitFor() being interrupted correctly - it just goes ahead and tries to obtain the exit code which will fail and leave the tested process running.
>
> The correct way is to forcibly destroy the process when process.waitFor() is interrupted or throws ExecutionException to make sure the process has actually exited before checking its exit code.
>
> Thanks,
>
> -JB-
More information about the serviceability-dev
mailing list