com php-src: Don't involve output check in the test: sapi/cli/tests/sapi_windows_set_ctrl_handler.phpt
| From: | Anatol Belski | Date: | Sat, 01 Jun 2019 21:31:05 +0000 |
| Subject: | com php-src: Don't involve output check in the test: sapi/cli/tests/sapi_windows_set_ctrl_handler.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-106512@lists.php.net to get a copy of this message | ||
Commit: 7a64150921bec4af9a18346405d1fff4f1ea84ea
Author: Anatol Belski <ab@php.net> Sat, 1 Jun 2019 23:31:05 +0200
Parents: 7faaeec942ac23b3cb396291e7c1cd696c733775
Branches: PHP-7.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7a64150921bec4af9a18346405d1fff4f1ea84ea
Log:
Don't involve output check in the test
Changed paths:
M sapi/cli/tests/sapi_windows_set_ctrl_handler.phpt
Diff:
diff --git a/sapi/cli/tests/sapi_windows_set_ctrl_handler.phpt
b/sapi/cli/tests/sapi_windows_set_ctrl_handler.phpt
index a5cb3ef...1505281 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