diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/curl/tests/bug64267.phpt | 4 | ||||
-rw-r--r-- | ext/curl/tests/server.inc | 12 | ||||
-rw-r--r-- | ext/opcache/tests/php_cli_server.inc | 12 |
3 files changed, 22 insertions, 6 deletions
diff --git a/ext/curl/tests/bug64267.phpt b/ext/curl/tests/bug64267.phpt index ca1fe4b368..302a853c25 100644 --- a/ext/curl/tests/bug64267.phpt +++ b/ext/curl/tests/bug64267.phpt @@ -17,8 +17,8 @@ var_dump(curl_setopt_array($c, [ CURLOPT_UPLOAD => true, CURLOPT_INFILE => $f, CURLOPT_INFILESIZE => filesize(__FILE__), - CURLOPT_CONNECTTIMEOUT => 1, - CURLOPT_TIMEOUT => 1, + CURLOPT_CONNECTTIMEOUT => 3, + CURLOPT_TIMEOUT => 3, ])); fclose($f); var_dump(curl_setopt_array($c, [ diff --git a/ext/curl/tests/server.inc b/ext/curl/tests/server.inc index 315fd68cc4..ed351b72cb 100644 --- a/ext/curl/tests/server.inc +++ b/ext/curl/tests/server.inc @@ -33,9 +33,9 @@ function curl_cli_server_start() { // note: even when server prints 'Listening on localhost:8964...Press Ctrl-C to quit.' // it might not be listening yet...need to wait until fsockopen() call returns - $error = "Unable to connect to servers\n"; + $error = "Unable to connect to server\n"; for ($i=0; $i < 60; $i++) { - usleep(25000); // 25ms per try + usleep(50000); // 50ms per try $status = proc_get_status($handle); $fp = @fsockopen(PHP_CURL_SERVER_HOSTNAME, PHP_CURL_SERVER_PORT); // Failure, the server is no longer running @@ -63,6 +63,14 @@ function curl_cli_server_start() { register_shutdown_function( function($handle) use($router) { proc_terminate($handle); + /* Wait for server to shutdown */ + for ($i = 0; $i < 60; $i++) { + $status = proc_get_status($handle); + if (!($status && $status['running'])) { + break; + } + usleep(50000); + } }, $handle ); diff --git a/ext/opcache/tests/php_cli_server.inc b/ext/opcache/tests/php_cli_server.inc index ca6854f553..456ed663b8 100644 --- a/ext/opcache/tests/php_cli_server.inc +++ b/ext/opcache/tests/php_cli_server.inc @@ -23,9 +23,9 @@ function php_cli_server_start($ini = "") { // note: even when server prints 'Listening on localhost:8964...Press Ctrl-C to quit.' // it might not be listening yet...need to wait until fsockopen() call returns - $error = "Unable to connect to servers\n"; + $error = "Unable to connect to server\n"; for ($i=0; $i < 60; $i++) { - usleep(25000); // 25ms per try + usleep(50000); // 50ms per try $status = proc_get_status($handle); $fp = @fsockopen(PHP_CLI_SERVER_HOSTNAME, PHP_CLI_SERVER_PORT); // Failure, the server is no longer running @@ -53,6 +53,14 @@ function php_cli_server_start($ini = "") { register_shutdown_function( function($handle) { proc_terminate($handle); + /* Wait for server to shutdown */ + for ($i = 0; $i < 60; $i++) { + $status = proc_get_status($handle); + if (!($status && $status['running'])) { + break; + } + usleep(50000); + } }, $handle ); |