summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2014-09-12 14:03:06 +0200
committerAnatol Belski <ab@php.net>2014-09-12 14:39:19 +0200
commit4db2181d4e5fad2ece558dcd72e4842e4f5b8d70 (patch)
tree7a72809764366637f2aa32c79732ac209460eb48 /ext
parent99fb5d0ea87866f9ef13a2e8840007004332c936 (diff)
downloadphp-git-4db2181d4e5fad2ece558dcd72e4842e4f5b8d70.tar.gz
make this test a bit more tolerant when checking sleep time
Diffstat (limited to 'ext')
-rw-r--r--ext/pdo_pgsql/tests/getnotify.phpt6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/pdo_pgsql/tests/getnotify.phpt b/ext/pdo_pgsql/tests/getnotify.phpt
index c093e0357a..c54a31604d 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));
?>