RFR 8056143: interrupted java/lang/management/MemoryMXBean/LowMemoryTest.java leaves running process
Jaroslav Bachorik
jaroslav.bachorik at oracle.com
Tue Oct 14 10:46:55 UTC 2014
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