提交 4b7a613d 编写于 作者: B bvaidya

8028094: TEST_BUG: java/lang/ProcessBuilder/Basic.java leaves "sleep 6666" processes behind

Reviewed-by: chegar
上级 20d4d888
...@@ -2016,6 +2016,7 @@ public class Basic { ...@@ -2016,6 +2016,7 @@ public class Basic {
&& new File("/bin/bash").exists() && new File("/bin/bash").exists()
&& new File("/bin/sleep").exists()) { && new File("/bin/sleep").exists()) {
final String[] cmd = { "/bin/bash", "-c", "(/bin/sleep 6666)" }; 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 ProcessBuilder pb = new ProcessBuilder(cmd);
final Process p = pb.start(); final Process p = pb.start();
final InputStream stdout = p.getInputStream(); final InputStream stdout = p.getInputStream();
...@@ -2043,6 +2044,7 @@ public class Basic { ...@@ -2043,6 +2044,7 @@ public class Basic {
stdout.close(); stdout.close();
stderr.close(); stderr.close();
stdin.close(); stdin.close();
new ProcessBuilder(cmdkill).start();
//---------------------------------------------------------- //----------------------------------------------------------
// There remain unsolved issues with asynchronous close. // There remain unsolved issues with asynchronous close.
// Here's a highly non-portable experiment to demonstrate: // Here's a highly non-portable experiment to demonstrate:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册