Mercurial > hg > nginx-tests
comparison proxy_limit_rate.t @ 787:a53c310c695d
Tests: relaxed limit_rate tests timeouts.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Mon, 16 Nov 2015 19:49:47 +0300 |
parents | 0940773278c7 |
children | e9064d691790 |
comparison
equal
deleted
inserted
replaced
786:4e6d21192037 | 787:a53c310c695d |
---|---|
61 my $r = http_get('/'); | 61 my $r = http_get('/'); |
62 | 62 |
63 my ($t1) = $r =~ /X-Msec: (\d+)/; | 63 my ($t1) = $r =~ /X-Msec: (\d+)/; |
64 my $diff = time() - $t1; | 64 my $diff = time() - $t1; |
65 | 65 |
66 # four chunks are split with three 1s delays + 1s error | 66 # four chunks are split with three 1s delays |
67 | 67 |
68 cmp_ok(abs($diff - 3), '<=', 1, 'proxy_limit_rate'); | 68 cmp_ok($diff, '>=', 3, 'proxy_limit_rate'); |
69 like($r, qr/^(XXXXXXXXXX){4000}\x0d?\x0a?$/m, 'response body'); | 69 like($r, qr/^(XXXXXXXXXX){4000}\x0d?\x0a?$/m, 'response body'); |
70 | 70 |
71 ############################################################################### | 71 ############################################################################### |