changeset 8853:cfbee8ee71bf

8028094: TEST_BUG: java/lang/ProcessBuilder/Basic.java leaves "sleep 6666" processes behind Reviewed-by: chegar
author bvaidya
date Tue, 19 Nov 2013 15:31:33 +0000
parents 40462a41b41b
children bfd4e632eeda
files test/java/lang/ProcessBuilder/Basic.java
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/test/java/lang/ProcessBuilder/Basic.java	Tue Nov 19 07:10:06 2013 -0800
+++ b/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: