Mercurial > hg > nginx-tests
diff stream_udp_limit_conn.t @ 935:25a4b2fdd3fb
Tests: I/O timeout options introduced in Stream.
Some tests wait for unreachable response for 5 seconds
before timeout that lead to unnecessary delay.
author | Andrey Zelenkov <zelenkov@nginx.com> |
---|---|
date | Tue, 24 May 2016 12:58:26 +0300 |
parents | 6bb1f2ccd386 |
children | e81cacf44cac |
line wrap: on
line diff
--- a/stream_udp_limit_conn.t +++ b/stream_udp_limit_conn.t @@ -87,18 +87,22 @@ my $s = dgram('127.0.0.1:8081'); is($s->io('1'), '1', 'passed'); -is(dgram('127.0.0.1:8081')->io('1'), '', 'rejected same zone'); +is(dgram('127.0.0.1:8081')->io('1', read_timeout => 0.1), '', + 'rejected same zone'); is(dgram('127.0.0.1:8082')->io('1'), '1', 'passed different zone'); is(dgram('127.0.0.1:8083')->io('1'), '1', 'passed same zone unlimited'); -is($s->io('2', read => 2), '12', 'long connection'); +sleep 1; # waiting for proxy_timeout to expire + +is($s->io('2', read => 2), '12', 'new connection after proxy_timeout'); is(dgram('127.0.0.1:8081')->io('2', read => 2), '12', 'passed 2'); # zones proxy chain is(dgram('127.0.0.1:8084')->io('1'), '1', 'passed proxy'); -is(dgram('127.0.0.1:8085')->io('1'), '', 'rejected proxy'); +is(dgram('127.0.0.1:8085')->io('1', read_timeout => 0.1), '', + 'rejected proxy'); ###############################################################################