1
0
mirror of https://github.com/php/php-src.git synced 2026-03-29 03:32:20 +02:00
Files
archived-php-src/sapi/fpm/tests/003.phpt
Mitch Hagstrand fd92b91188 Increase wait time for tests involving sockets to improve Travis relability
1. Increased sleep time from 25ms to 50ms
2. Added sleep to shutdown handlers
2017-01-13 06:45:04 +00:00

55 lines
1.0 KiB
PHP

--TEST--
FPM: Test IPv6 support
--SKIPIF--
<?php include "skipif.inc";
@stream_socket_client('tcp://[::1]:0', $errno);
if ($errno != 111) die('skip IPv6 not supported.');
?>
--FILE--
<?php
include "include.inc";
$logfile = dirname(__FILE__).'/php-fpm.log.tmp';
$port = 9000+PHP_INT_SIZE;
$cfg = <<<EOT
[global]
error_log = $logfile
[unconfined]
listen = [::1]:$port
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
EOT;
$fpm = run_fpm($cfg, $tail);
if (is_resource($fpm)) {
fpm_display_log($tail, 2);
$i = 0;
while (($i++ < 60) && !($fp = fsockopen('[::1]', $port))) {
usleep(50000);
}
if ($fp) {
echo "Done\n";
fclose($fp);
}
proc_terminate($fpm);
stream_get_contents($tail);
fclose($tail);
proc_close($fpm);
}
?>
--EXPECTF--
[%d-%s-%d %d:%d:%d] NOTICE: fpm is running, pid %d
[%d-%s-%d %d:%d:%d] NOTICE: ready to handle connections
Done
--CLEAN--
<?php
$logfile = dirname(__FILE__).'/php-fpm.log.tmp';
@unlink($logfile);
?>