com php-src: Fixed the test, and make it faster while failingt: ext/standard/tests/streams/bug70198.phpt
| From: | Xinchen Hui | Date: | Tue, 11 Aug 2015 14:30:02 +0000 |
| Subject: | com php-src: Fixed the test, and make it faster while failingt: ext/standard/tests/streams/bug70198.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-88467@lists.php.net to get a copy of this message | ||
Commit: faa3c9d291e7bfa3168f3efe136e9199c0963678
Author: Xinchen Hui <laruence@php.net> Tue, 11 Aug 2015 22:30:02 +0800
Parents: ec1e8929c4e4c287d919945811475905e1391b7f
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=faa3c9d291e7bfa3168f3efe136e9199c0963678
Log:
Fixed the test, and make it faster while failingt
Changed paths:
M ext/standard/tests/streams/bug70198.phpt
Diff:
diff --git a/ext/standard/tests/streams/bug70198.phpt b/ext/standard/tests/streams/bug70198.phpt
index f3a608f..ea93d51 100644
--- a/ext/standard/tests/streams/bug70198.phpt
+++ b/ext/standard/tests/streams/bug70198.phpt
@@ -13,21 +13,19 @@ if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
- on the client side - sleep(1) and check feof()
*/
-$srv_addr = "tcp://127.0.0.1:8085";
+$srv_addr = "tcp://127.0.0.1:8964";
$srv_fl = dirname(__FILE__) . "/bug70198_svr_" . md5(uniqid()) . ".php";
$srv_fl_cont = <<<SRV
<?php
\$socket = stream_socket_server('$srv_addr', \$errno, \$errstr);
if (!\$socket) {
- echo "\$errstr (\$errno)<br />\\n";
+ echo "\$errstr (\$errno)\\n";
} else {
- while (\$conn = stream_socket_accept(\$socket)) {
-
+ if (\$conn = stream_socket_accept(\$socket, 3)) {
/* just close the connection immediately after accepting,
the client side will need wait a bit longer to realize it.*/
fclose(\$conn);
- break;
}
fclose(\$socket);
}
@@ -37,9 +35,11 @@ $dummy0 = $dummy1 = array();
$srv_proc = proc_open(PHP_BINARY . " -n $srv_fl", $dummy0, $dummy1);
$i = 0;
+/* wait a bit for the server startup */
+sleep(1);
$fp = stream_socket_client($srv_addr, $errno, $errstr, 1);
if (!$fp) {
- echo "$errstr ($errno)<br />\n";
+ echo "$errstr ($errno)\n";
} else {
stream_set_blocking($fp, 0);
sleep(1);
@@ -50,7 +50,6 @@ if (!$fp) {
var_dump($i);
}
-
proc_close($srv_proc);
unlink($srv_fl);
?>