diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2020-07-29 12:33:46 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2020-07-29 12:46:14 +0200 |
commit | f8792443a2c4c69d58a62ad32f2cbc3948774f53 (patch) | |
tree | f1c42f0d34c45b0ff8f4e3b5a77c7cf4f2b08396 /sapi/cli | |
parent | 678f5b60681543d891aa33efa88ccce476d3ddde (diff) | |
download | php-git-f8792443a2c4c69d58a62ad32f2cbc3948774f53.tar.gz |
Prevent test case from stalling
If the CTRL-C event can't be sent to the child for whatever reason, the
test will never terminate, because `proc_close()` waits for an infinite
amount of time. Therefore, we `proc_terminate()` the child instead,
after explicitly closing the pipes.
Diffstat (limited to 'sapi/cli')
-rw-r--r-- | sapi/cli/tests/sapi_windows_set_ctrl_handler.phpt | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sapi/cli/tests/sapi_windows_set_ctrl_handler.phpt b/sapi/cli/tests/sapi_windows_set_ctrl_handler.phpt index 2b675a7f71..4f1963d052 100644 --- a/sapi/cli/tests/sapi_windows_set_ctrl_handler.phpt +++ b/sapi/cli/tests/sapi_windows_set_ctrl_handler.phpt @@ -56,11 +56,13 @@ if ($is_child) { $status = proc_get_status($proc); if ($status["running"]) { echo "Child $child_pid didn't exit after ${max}us\n"; + foreach ($pipes as $pipe) { + fclose($pipe); + } + proc_terminate($proc); } else { echo "Child $child_pid exit with status ", $status["exitcode"], " after ${total}us\n"; } - - proc_close($proc); } function get_evt_name(int $evt) : ?string |