summaryrefslogtreecommitdiff
path: root/ext/pdo_pgsql/tests
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2016-12-15 12:20:37 +0100
committerAnatol Belski <ab@php.net>2016-12-15 12:20:37 +0100
commit8bc3f179cef87e675cb06872b8eeec22591e20be (patch)
treef14b97de76992ee92482771d5f17b0f506609dda /ext/pdo_pgsql/tests
parent7c696fa886c51d556c5d15419df5a04e179b4534 (diff)
downloadphp-git-8bc3f179cef87e675cb06872b8eeec22591e20be.tar.gz
make timing check more forgiving in these tests
Particularly on slower VMs, the sporadic fails can still happen. The timing is kept in an uncritical range, but allows the tests pass there. Mayby, it'd make sense to introduce a new group for this kind of tests, so tests requiring exact time measurement can be avoided on unsuitable environments.
Diffstat (limited to 'ext/pdo_pgsql/tests')
-rw-r--r--ext/pdo_pgsql/tests/getnotify.phpt4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/pdo_pgsql/tests/getnotify.phpt b/ext/pdo_pgsql/tests/getnotify.phpt
index c54a31604d..27eef9d740 100644
--- a/ext/pdo_pgsql/tests/getnotify.phpt
+++ b/ext/pdo_pgsql/tests/getnotify.phpt
@@ -71,7 +71,7 @@ var_dump($db->pgsqlGetNotify());
$t = microtime(1);
$notify = $db->pgsqlGetNotify(PDO::FETCH_ASSOC, 1000);
$diff = microtime(1) - $t;
-var_dump($diff >= 1 || 1 - abs($diff) < .01);
+var_dump($diff >= 1 || 1 - abs($diff) < .05);
var_dump($notify);
// Test second parameter, should return immediately because a notify is queued
@@ -79,7 +79,7 @@ $db->exec("NOTIFY notifies_phpt");
$t = microtime(1);
$notify = $db->pgsqlGetNotify(PDO::FETCH_ASSOC, 5000);
$diff = microtime(1) - $t;
-var_dump($diff < 1 || abs(1 - abs($diff)) < .01);
+var_dump($diff < 1 || abs(1 - abs($diff)) < .05);
var_dump(count($notify));
?>