1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Make proc_open_bug69900.phpt more robust against parallelization

With multiple workers running this might take more than 1ms. Bump
this up to the same threshold that was already used for CI.
This commit is contained in:
Nikita Popov
2019-02-19 15:13:11 +01:00
parent f5872614d8
commit 0513d59ed3

View File

@@ -6,7 +6,7 @@ Bug #69900 Commandline input/output weird behaviour with STDIO
error_reporting(E_ALL);
$fl = dirname(__FILE__) . DIRECTORY_SEPARATOR . "test69900.php";
$max_ms = ((bool)getenv('TRAVIS') || (bool)getenv('APPVEYOR')) ? 10 : 1;
$max_ms = 10;
$test_content = '<?php
@@ -34,7 +34,13 @@ for($i = 0; $i < 10; $i++){
$t1 = microtime(1);
echo $s;
echo "fgets() took ", (($t1 - $t0)*1000 > $max_ms ? 'more' : 'less'), " than $max_ms ms\n";
$dt_ms = ($t1 - $t0)*1000;
if ($dt_ms > $max_ms) {
echo "fgets() took more than $max_ms ms ($dt_ms ms)\n";
} else {
echo "fgets() took less than $max_ms ms\n";
}
}
fclose($pipes[0]);
@@ -51,7 +57,7 @@ $fl = dirname(__FILE__) . DIRECTORY_SEPARATOR . "test69900.php";
?>
--EXPECTF--
hello0
fgets() took more than %d ms
fgets() took more than %d ms (%s ms)
hello1
fgets() took less than %d ms
hello2