Mercurial > hg > nginx-tests
changeset 634:40675bfad7d3
Tests: fixed stream limit rate tests.
Relaxed time error values to make tests safe on slow hosts.
author | Andrey Zelenkov <zelenkov@nginx.com> |
---|---|
date | Tue, 21 Jul 2015 15:41:55 +0300 |
parents | cf89559cd558 |
children | bc91b86a71ee |
files | stream_limit_rate.t |
diffstat | 1 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/stream_limit_rate.t Wed Jul 15 23:04:29 2015 +0300 +++ b/stream_limit_rate.t Tue Jul 21 15:41:55 2015 +0300 @@ -71,13 +71,13 @@ server { listen 127.0.0.1:8085; proxy_pass 127.0.0.1:8080; - proxy_download_rate 500; + proxy_download_rate 250; } server { listen 127.0.0.1:8086; proxy_pass 127.0.0.1:8090; - proxy_upload_rate 500; + proxy_upload_rate 250; } } @@ -115,19 +115,19 @@ } -# Three chunks are split with two 1s delays + 1s error: +# Five chunks are split with four 1s delays + 2s error: # the first two chunks are halfs of test string # and the third 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 - 2), '<=', 1, 'download - time'); +cmp_ok(abs($diff - 4), '<=', 2, '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 - 2), '<=', 1, 'upload - time'); +cmp_ok(abs($diff - 4), '<=', 2, 'upload - time'); is($r{'data'}, $str . 'close', 'upload - data'); ###############################################################################