projects
/
m6w6
/
ext-http
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
|
github
raw
|
patch
| inline |
side by side
(parent:
57476a6
)
use a random port offset
author
Michael Wallner
<mike@php.net>
Thu, 19 Feb 2015 20:07:03 +0000
(21:07 +0100)
committer
Michael Wallner
<mike@php.net>
Thu, 19 Feb 2015 20:07:03 +0000
(21:07 +0100)
tests/helper/server.inc
patch
|
blob
|
history
diff --git
a/tests/helper/server.inc
b/tests/helper/server.inc
index 265a861a4a9129656c24adc529d4f70fd99780f8..e3b7af6a956f4b3b58a5b2a159e0396008c0f977 100644
(file)
--- a/
tests/helper/server.inc
+++ b/
tests/helper/server.inc
@@
-11,7
+11,11
@@
if ($php) {
}
function serve($cb) {
- foreach (range(8000+PHP_INT_SIZE, 9000) as $port) {
+ /* stream_socket_server() automatically sets SO_REUSEADDR,
+ * which is, well, bad if the tests are run in parallel
+ */
+ $offset = rand(0,2000);
+ foreach (range(8000+$offset, 9000+$offset) as $port) {
if (($server = @stream_socket_server("tcp://localhost:$port"))) {
fprintf(STDERR, "%s\n", $port);
do {