From d8a0b1a9e3d4ca2ae2a99ea0db14756c0fc0db87 Mon Sep 17 00:00:00 2001 From: Rasmus Lerdorf Date: Wed, 7 Sep 2011 18:09:34 +0000 Subject: [PATCH] This test was added to verify that bug 39322 was fixed, which the test does test for and this works. However, it consistently failed because it relied on a SIGHUP not terminating a sh -c /usr/bin/nohup sleep 50 process which doesn't work because the SIGHUP goes to the sh process not the nohup'ed sleep process. So, I have sped up the test and removed the nohup and instead of trying to SIGHUP I am just doing the equivalent of a kill 0 on it to verify that the resource sticks around. --- .../tests/general_functions/proc_open02.phpt | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/ext/standard/tests/general_functions/proc_open02.phpt b/ext/standard/tests/general_functions/proc_open02.phpt index 3406f6806c..d5d878ed24 100644 --- a/ext/standard/tests/general_functions/proc_open02.phpt +++ b/ext/standard/tests/general_functions/proc_open02.phpt @@ -3,7 +3,6 @@ proc_open --SKIPIF-- --FILE-- @@ -11,19 +10,19 @@ if (getenv('SKIP_SLOW_TESTS')) echo 'skip slow test'; $ds = array(array('pipe', 'r')); $cat = proc_open( - '/usr/bin/nohup /bin/sleep 50', + '/bin/sleep 2', $ds, $pipes ); -sleep(1); // let the OS run the nohup process before sending the signal +usleep(20000); // let the OS run the sleep process before sending the signal -var_dump(proc_terminate($cat, 1)); // send a SIGHUP -sleep(1); +var_dump(proc_terminate($cat, 0)); // status check +usleep(20000); var_dump(proc_get_status($cat)); var_dump(proc_terminate($cat)); // now really quit it -sleep(1); +usleep(20000); var_dump(proc_get_status($cat)); proc_close($cat); @@ -35,7 +34,7 @@ echo "Done!\n"; bool(true) array(8) { ["command"]=> - string(28) "/usr/bin/nohup /bin/sleep 50" + string(12) "/bin/sleep 2" ["pid"]=> int(%d) ["running"]=> @@ -54,7 +53,7 @@ array(8) { bool(true) array(8) { ["command"]=> - string(28) "/usr/bin/nohup /bin/sleep 50" + string(12) "/bin/sleep 2" ["pid"]=> int(%d) ["running"]=> -- 2.40.0