From 10babebb7f589d598e5b6daa4f3dc5979b239a62 Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Fri, 17 Nov 2023 01:44:38 +0100 Subject: bigger tolerances; five second timeout sometimes failed to abort a six second sleep on server --- test/it_url_slow.t | 7 ++++--- 1 file 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 -- cgit v1.2.3