com php-src: Prevent test case from stalling: sapi/cli/tests/sa pi_windows_set_ctrl_handler.phpt
| From: | Christoph Michael Becker | Date: | Wed, 29 Jul 2020 10:46:14 +0000 |
| Subject: | com php-src: Prevent test case from stalling: sapi/cli/tests/sa pi_windows_set_ctrl_handler.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-112430@lists.php.net to get a copy of this message | ||
Commit: f8792443a2c4c69d58a62ad32f2cbc3948774f53
Author: Christoph M. Becker <cmbecker69@gmx.de> Wed, 29 Jul 2020 12:33:46 +0200
Parents: 678f5b60681543d891aa33efa88ccce476d3ddde
Branches: PHP-7.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f8792443a2c4c69d58a62ad32f2cbc3948774f53
Log:
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.
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 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