Match number of servers started

This commit is contained in:
Zach Borboa
2021-03-28 23:44:25 -04:00
parent 3a095e7780
commit 64df98c50f
2 changed files with 12 additions and 11 deletions
+2 -2
View File
@@ -3,12 +3,12 @@ require __DIR__ . '/../vendor/autoload.php';
use Curl\MultiCurl;
$server_count = 5;
$server_count = 7;
$urls = [];
$port = 8000;
for ($i = 0; $i < $server_count; $i++) {
$port += 1;
$urls[] = 'http://localhost:' . $port . '/';
$port += 1;
}
$multi_curl = new MultiCurl();
+10 -9
View File
@@ -1,12 +1,5 @@
start_php_servers() {
for i in $(seq 0 6); do
port=8000
(( port += $i ))
php -S "127.0.0.1:${port}" -t tests/PHPCurlClass/ &
done
}
set -x
echo "CI_PHP_VERSION: ${CI_PHP_VERSION}"
php -r "var_dump(phpversion());"
php -r "var_dump(curl_version());"
@@ -17,4 +10,12 @@ composer install --prefer-source --no-interaction
# Let test server know we should allow testing.
export PHP_CURL_CLASS_TEST_MODE_ENABLED="yes"
start_php_servers
# Start test servers. Run servers on different ports to allow simultaneous
# requests without blocking.
server_count=7
for i in $(seq 0 $(("${server_count}" - 1))); do
port=8000
(( port += $i ))
php -S "127.0.0.1:${port}" -t tests/PHPCurlClass/ &
done