com php-src: relax test on travis: ext/standard/tests/streams/p roc_open_bug69900.phpt
| From: | Anatol Belski | Date: | Thu, 27 Jul 2017 22:27:11 +0000 |
| Subject: | com php-src: relax test on travis: ext/standard/tests/streams/p roc_open_bug69900.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-98839@lists.php.net to get a copy of this message | ||
Commit: b01336814d17544a4f16784d5bb041ae068486d6
Author: Anatol Belski <ab@php.net> Fri, 28 Jul 2017 00:27:11 +0200
Parents: 34e5d3a87d0b0a01578754b646f50d01a087ba7c
Branches: PHP-7.0 PHP-7.1 PHP-7.2 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b01336814d17544a4f16784d5bb041ae068486d6
Log:
relax test on travis
Changed paths:
M ext/standard/tests/streams/proc_open_bug69900.phpt
Diff:
diff --git a/ext/standard/tests/streams/proc_open_bug69900.phpt
b/ext/standard/tests/streams/proc_open_bug69900.phpt
index 86e323e..76c8ff4 100644
--- a/ext/standard/tests/streams/proc_open_bug69900.phpt
+++ b/ext/standard/tests/streams/proc_open_bug69900.phpt
@@ -6,6 +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')) ? 3 : 1;
$test_content = '<?php
@@ -33,7 +34,7 @@ for($i = 0; $i < 10; $i++){
$t1 = microtime(1);
echo $s;
- echo "fgets() took ", (($t1 - $t0)*1000 > 1 ? 'more' : 'less'),
" than 1 ms\n";
+ echo "fgets() took ", (($t1 - $t0)*1000 > $max_ms ? 'more' :
'less'), " than $max_ms ms\n";
}
fclose($pipes[0]);
@@ -48,25 +49,25 @@ proc_close($process);
$fl = dirname(__FILE__) . DIRECTORY_SEPARATOR . "test69900.php";
@unlink($fl);
?>
---EXPECT--
+--EXPECTF--
hello0
-fgets() took more than 1 ms
+fgets() took more than %d ms
hello1
-fgets() took less than 1 ms
+fgets() took less than %d ms
hello2
-fgets() took less than 1 ms
+fgets() took less than %d ms
hello3
-fgets() took less than 1 ms
+fgets() took less than %d ms
hello4
-fgets() took less than 1 ms
+fgets() took less than %d ms
hello5
-fgets() took less than 1 ms
+fgets() took less than %d ms
hello6
-fgets() took less than 1 ms
+fgets() took less than %d ms
hello7
-fgets() took less than 1 ms
+fgets() took less than %d ms
hello8
-fgets() took less than 1 ms
+fgets() took less than %d ms
hello9
-fgets() took less than 1 ms
+fgets() took less than %d ms
===DONE===