# HG changeset patch # User Sergey Kandaurov # Date 1447692587 -10800 # Node ID a53c310c695d8512133912dee44860f9275be9ef # Parent 4e6d211920378d29b3df08ec799b1cfae947ff61 Tests: relaxed limit_rate tests timeouts. diff --git a/proxy_limit_rate.t b/proxy_limit_rate.t --- 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'); ############################################################################### diff --git a/stream_limit_rate.t b/stream_limit_rate.t --- 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'); ###############################################################################