8028094: TEST_BUG: java/lang/ProcessBuilder/Basic.java leaves "sleep 6666" processes behind
Reviewed-by: chegar
--- a/jdk/test/java/lang/ProcessBuilder/Basic.java Tue Nov 19 07:10:06 2013 -0800
+++ b/jdk/test/java/lang/ProcessBuilder/Basic.java Tue Nov 19 15:31:33 2013 +0000
@@ -2016,6 +2016,7 @@
&& new File("/bin/bash").exists()
&& new File("/bin/sleep").exists()) {
final String[] cmd = { "/bin/bash", "-c", "(/bin/sleep 6666)" };
+ final String[] cmdkill = { "/bin/bash", "-c", "(/usr/bin/pkill -f \"sleep 6666\")" };
final ProcessBuilder pb = new ProcessBuilder(cmd);
final Process p = pb.start();
final InputStream stdout = p.getInputStream();
@@ -2043,6 +2044,7 @@
stdout.close();
stderr.close();
stdin.close();
+ new ProcessBuilder(cmdkill).start();
//----------------------------------------------------------
// There remain unsolved issues with asynchronous close.
// Here's a highly non-portable experiment to demonstrate: