changeset 787:a53c310c695d

Tests: relaxed limit_rate tests timeouts.
author Sergey Kandaurov <pluknet@nginx.com>
date Mon, 16 Nov 2015 19:49:47 +0300
parents 4e6d21192037
children 1f48ed26b49a
files proxy_limit_rate.t stream_limit_rate.t
diffstat 2 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/proxy_limit_rate.t
+++ b/proxy_limit_rate.t
@@ -63,9 +63,9 @@ my $r = http_get('/');
 my ($t1) = $r =~ /X-Msec: (\d+)/;
 my $diff = time() - $t1;
 
-# four chunks are split with three 1s delays + 1s error
+# four chunks are split with three 1s delays
 
-cmp_ok(abs($diff - 3), '<=', 1, 'proxy_limit_rate');
+cmp_ok($diff, '>=', 3, 'proxy_limit_rate');
 like($r, qr/^(XXXXXXXXXX){4000}\x0d?\x0a?$/m, 'response body');
 
 ###############################################################################
--- a/stream_limit_rate.t
+++ b/stream_limit_rate.t
@@ -115,19 +115,19 @@ is($r{'data'}, '1', 'upload - one byte')
 
 }
 
-# Five chunks are split with four 1s delays + 2s error:
+# Five chunks are split with four 1s delays:
 # the first four chunks are quarters of test string
 # and the fifth one is some extra data from backend.
 
 %r = stream_get($str, peer =>  '127.0.0.1:8085');
 my $diff = time() - $r{'time'};
-cmp_ok(abs($diff - 4), '<=', 2, 'download - time');
+cmp_ok($diff, '>=', 4, 'download - time');
 is($r{'data'}, $str, 'download - data');
 
 my $time = time();
 %r = stream_get($str . 'close', peer => '127.0.0.1:8086');
 $diff = time() - $time;
-cmp_ok(abs($diff - 4), '<=', 2, 'upload - time');
+cmp_ok($diff, '>=', 4, 'upload - time');
 is($r{'data'}, $str . 'close', 'upload - data');
 
 ###############################################################################