summaryrefslogtreecommitdiff
path: root/test/it_url_slow.t
diff options
context:
space:
mode:
authorUrban Müller2023-11-17 01:44:38 +0100
committerUrban Müller2023-11-17 01:44:38 +0100
commit10babebb7f589d598e5b6daa4f3dc5979b239a62 (patch)
tree2f47f115efdb1526f1b9439ee32f12041aa15831 /test/it_url_slow.t
parent5dedcb92a63094351bf00f94cc0691c82ed4a2d4 (diff)
downloaditools-10babebb7f589d598e5b6daa4f3dc5979b239a62.tar.gz
itools-10babebb7f589d598e5b6daa4f3dc5979b239a62.tar.bz2
itools-10babebb7f589d598e5b6daa4f3dc5979b239a62.zip
bigger tolerances; five second timeout sometimes failed to abort a six second sleep on server
Diffstat (limited to 'test/it_url_slow.t')
-rwxr-xr-xtest/it_url_slow.t7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/it_url_slow.t b/test/it_url_slow.t
index 1f43edc..b131322 100755
--- a/test/it_url_slow.t
+++ b/test/it_url_slow.t
@@ -17,11 +17,12 @@ handle_server(
$start = microtime(true);
$res = ok(
- !it_url::get(['url' => 'http://localhost:8000/long_sleep', 'timeout' => 5, 'retries' => 0, 'it_error' => false]),
+ !it_url::get(['url' => 'http://localhost:8000/long_sleep', 'timeout' => 4, 'retries' => 0, 'it_error' => false]),
'it_url::get() fails after timeout seconds with no output'
);
-$res2 = is(
- intval(microtime(true) - $start), 5,
+$duration = microtime(true) - $start;
+$res2 = ok(
+ $duration >= 4 && $duration <= 6,
'... and fails as soon as timeout is surpassed'
);
sleep(1); # wait for testserver