mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-19 01:51:33 +00:00
Match number of servers started
This commit is contained in:
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user