Skip to content

Commit 09ac6eb

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Don't involve output check in the test
2 parents 7393777 + 7a64150 commit 09ac6eb

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

sapi/cli/tests/sapi_windows_set_ctrl_handler.phpt

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ $is_child = isset($argv[1]);
1717
if ($is_child) {
1818
function handler($evt)
1919
{
20-
echo "\nCaught " . get_evt_name($evt), ", wait, wait ...!\n";
21-
exit;
20+
exit(3);
2221
}
2322

2423
sapi_windows_set_ctrl_handler('handler');
@@ -46,10 +45,21 @@ if ($is_child) {
4645
echo "Sending ", get_evt_name($evt), " to child $child_pid\n";
4746
$ret = sapi_windows_generate_ctrl_event($evt, $child_pid);
4847

49-
echo "Child said: \"", trim(fread($pipes[1], 48)), "\"\n";
50-
5148
echo ($ret ? "Successfully" : "Unsuccessfuly"), " sent ", get_evt_name($evt), " to child $child_pid\n";
5249

50+
$max = 5000; $total = 0; $step = 100;
51+
while(proc_get_status($proc)["running"] && $max > $total) {
52+
usleep($step);
53+
$total += $step;
54+
}
55+
56+
$status = proc_get_status($proc);
57+
if ($status["running"]) {
58+
echo "Child $child_pid didn't exit after ${max}us\n";
59+
} else {
60+
echo "Child $child_pid exit with status ", $status["exitcode"], " after ${total}us\n";
61+
}
62+
5363
proc_close($proc);
5464
}
5565

@@ -70,6 +80,6 @@ Started child %d
7080
Running `tasklist /FI "PID eq %d" /NH` to check the process indeed exists:
7181
php.exe%w%d%s1%s
7282
Sending CTRL+C to child %d
73-
Child said: "Caught CTRL+C, wait, wait ...!"
7483
Successfully sent CTRL+C to child %d
84+
Child %d exit with status 3 after %dus
7585

0 commit comments

Comments
 (0)