From: Rasmus Lerdorf Date: Wed, 7 Sep 2011 18:09:34 +0000 (+0000) Subject: This test was added to verify that bug 39322 was fixed, which the test X-Git-Tag: php-5.4.0beta1~112 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6f03c9e38e4b5b823f632ba4c06106c14788e45c;p=php 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. --- 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"]=>