Annotation of embedaddon/php/ext/standard/tests/general_functions/bug39322.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Bug #39322 (proc_terminate() loosing process resource)
3: --SKIPIF--
4: <?php
5: if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
6: if (!is_executable('/bin/sleep')) echo 'skip sleep not found';
7: ?>
8: --FILE--
9: <?php
10: $descriptors = array(
11: 0 => array('pipe', 'r'),
12: 1 => array('pipe', 'w'),
13: 2 => array('pipe', 'w'));
14:
15: $pipes = array();
16:
17: $process = proc_open('/bin/sleep 120', $descriptors, $pipes);
18:
19: proc_terminate($process, 9);
20: sleep(1); // wait a bit to let the process finish
21: var_dump(proc_get_status($process));
22:
23: echo "Done!\n";
24:
25: ?>
26: --EXPECTF--
27: array(8) {
28: ["command"]=>
29: string(14) "/bin/sleep 120"
30: ["pid"]=>
31: int(%d)
32: ["running"]=>
33: bool(false)
34: ["signaled"]=>
35: bool(true)
36: ["stopped"]=>
37: bool(false)
38: ["exitcode"]=>
39: int(-1)
40: ["termsig"]=>
41: int(9)
42: ["stopsig"]=>
43: int(0)
44: }
45: Done!
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>