summaryrefslogtreecommitdiff
path: root/sapi/cli/tests
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2019-06-01 23:31:05 +0200
committerAnatol Belski <ab@php.net>2019-06-01 23:31:05 +0200
commit7a64150921bec4af9a18346405d1fff4f1ea84ea (patch)
tree654b69f96781fd40a6cc97cd09479e6c35d99b87 /sapi/cli/tests
parent7faaeec942ac23b3cb396291e7c1cd696c733775 (diff)
downloadphp-git-7a64150921bec4af9a18346405d1fff4f1ea84ea.tar.gz
Don't involve output check in the test
Diffstat (limited to 'sapi/cli/tests')
-rw-r--r--sapi/cli/tests/sapi_windows_set_ctrl_handler.phpt20
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