Skip to content

Commit 0513d59

Browse files
committed
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.
1 parent f587261 commit 0513d59

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

ext/standard/tests/streams/proc_open_bug69900.phpt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Bug #69900 Commandline input/output weird behaviour with STDIO
66
error_reporting(E_ALL);
77

88
$fl = dirname(__FILE__) . DIRECTORY_SEPARATOR . "test69900.php";
9-
$max_ms = ((bool)getenv('TRAVIS') || (bool)getenv('APPVEYOR')) ? 10 : 1;
9+
$max_ms = 10;
1010

1111
$test_content = '<?php
1212
@@ -34,7 +34,13 @@ for($i = 0; $i < 10; $i++){
3434
$t1 = microtime(1);
3535

3636
echo $s;
37-
echo "fgets() took ", (($t1 - $t0)*1000 > $max_ms ? 'more' : 'less'), " than $max_ms ms\n";
37+
38+
$dt_ms = ($t1 - $t0)*1000;
39+
if ($dt_ms > $max_ms) {
40+
echo "fgets() took more than $max_ms ms ($dt_ms ms)\n";
41+
} else {
42+
echo "fgets() took less than $max_ms ms\n";
43+
}
3844
}
3945

4046
fclose($pipes[0]);
@@ -51,7 +57,7 @@ $fl = dirname(__FILE__) . DIRECTORY_SEPARATOR . "test69900.php";
5157
?>
5258
--EXPECTF--
5359
hello0
54-
fgets() took more than %d ms
60+
fgets() took more than %d ms (%s ms)
5561
hello1
5662
fgets() took less than %d ms
5763
hello2

0 commit comments

Comments
 (0)