com php-src: fix test: ext/pdo_pgsql/tests/getnotify.phpt
| From: | Anatol Belski | Date: | Sun, 23 Aug 2015 15:27:53 +0000 |
| Subject: | com php-src: fix test: ext/pdo_pgsql/tests/getnotify.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-88737@lists.php.net to get a copy of this message | ||
Commit: b460b530d633faf0aa6db9650dd15446dadea3db
Author: Anatol Belski <ab@php.net> Sun, 23 Aug 2015 13:06:00 +0200
Parents: 24e78ec1d830b7dac15ad53bd0a1079a3dbaf5dd
Branches: PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b460b530d633faf0aa6db9650dd15446dadea3db
Log:
fix test
backport from master
Changed paths:
M ext/pdo_pgsql/tests/getnotify.phpt
Diff:
diff --git a/ext/pdo_pgsql/tests/getnotify.phpt b/ext/pdo_pgsql/tests/getnotify.phpt
index c093e03..c54a316 100644
--- a/ext/pdo_pgsql/tests/getnotify.phpt
+++ b/ext/pdo_pgsql/tests/getnotify.phpt
@@ -70,14 +70,16 @@ var_dump($db->pgsqlGetNotify());
// Test second parameter, should wait 2 seconds because no notify is queued
$t = microtime(1);
$notify = $db->pgsqlGetNotify(PDO::FETCH_ASSOC, 1000);
-var_dump((microtime(1) - $t) >= 1);
+$diff = microtime(1) - $t;
+var_dump($diff >= 1 || 1 - abs($diff) < .01);
var_dump($notify);
// Test second parameter, should return immediately because a notify is queued
$db->exec("NOTIFY notifies_phpt");
$t = microtime(1);
$notify = $db->pgsqlGetNotify(PDO::FETCH_ASSOC, 5000);
-var_dump((microtime(1) - $t) < 1);
+$diff = microtime(1) - $t;
+var_dump($diff < 1 || abs(1 - abs($diff)) < .01);
var_dump(count($notify));
?>