diff options
author | Anatol Belski <ab@php.net> | 2019-06-01 23:33:00 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2019-06-01 23:33:00 +0200 |
commit | 09ac6eb36d54aedd19466ca739f99c97a9fd21ad (patch) | |
tree | 1a2132471d23986e777fa7b57e8667b4d1efd2c3 | |
parent | 7393777da97977db5a4786a4dbe765bde4bc3921 (diff) | |
parent | 7a64150921bec4af9a18346405d1fff4f1ea84ea (diff) | |
download | php-git-09ac6eb36d54aedd19466ca739f99c97a9fd21ad.tar.gz |
Merge branch 'PHP-7.4'
* PHP-7.4:
Don't involve output check in the test
-rw-r--r-- | sapi/cli/tests/sapi_windows_set_ctrl_handler.phpt | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/sapi/cli/tests/sapi_windows_set_ctrl_handler.phpt b/sapi/cli/tests/sapi_windows_set_ctrl_handler.phpt index a5cb3ef03e..1505281dd3 100644 --- a/sapi/cli/tests/sapi_windows_set_ctrl_handler.phpt +++ b/sapi/cli/tests/sapi_windows_set_ctrl_handler.phpt @@ -17,8 +17,7 @@ $is_child = isset($argv[1]); if ($is_child) { function handler($evt) { - echo "\nCaught " . get_evt_name($evt), ", wait, wait ...!\n"; - exit; + exit(3); } sapi_windows_set_ctrl_handler('handler'); @@ -46,10 +45,21 @@ if ($is_child) { echo "Sending ", get_evt_name($evt), " to child $child_pid\n"; $ret = sapi_windows_generate_ctrl_event($evt, $child_pid); - echo "Child said: \"", trim(fread($pipes[1], 48)), "\"\n"; - echo ($ret ? "Successfully" : "Unsuccessfuly"), " sent ", get_evt_name($evt), " to child $child_pid\n"; + $max = 5000; $total = 0; $step = 100; + while(proc_get_status($proc)["running"] && $max > $total) { + usleep($step); + $total += $step; + } + + $status = proc_get_status($proc); + if ($status["running"]) { + echo "Child $child_pid didn't exit after ${max}us\n"; + } else { + echo "Child $child_pid exit with status ", $status["exitcode"], " after ${total}us\n"; + } + proc_close($proc); } @@ -70,6 +80,6 @@ Started child %d Running `tasklist /FI "PID eq %d" /NH` to check the process indeed exists: php.exe%w%d%s1%s Sending CTRL+C to child %d -Child said: "Caught CTRL+C, wait, wait ...!" Successfully sent CTRL+C to child %d +Child %d exit with status 3 after %dus |