Mercurial > hg > nginx-tests
comparison limit_conn_complex.t @ 477:c94fc8e41f5f
Tests: adjusted limit_conn_complex.t tests.
Bump limit_req burst value to make a room for delaying a request for the
second time. Wait to establish a preliminary connection that is used to
exhaust the upper limit_conn limit before executing the limit_conn tests.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Fri, 17 Oct 2014 13:12:28 +0400 |
parents | c872b2c9645f |
children | 907e89fba9c3 |
comparison
equal
deleted
inserted
replaced
476:4e335141aa4b | 477:c94fc8e41f5f |
---|---|
55 limit_conn conn 1; | 55 limit_conn conn 1; |
56 proxy_pass http://127.0.0.1:8080/req; | 56 proxy_pass http://127.0.0.1:8080/req; |
57 } | 57 } |
58 | 58 |
59 location /req { | 59 location /req { |
60 limit_req zone=req burst=1; | 60 limit_req zone=req burst=2; |
61 } | 61 } |
62 } | 62 } |
63 } | 63 } |
64 | 64 |
65 EOF | 65 EOF |
83 ok(IO::Select->new($s)->can_read(0.1), 'limit_req different key'); | 83 ok(IO::Select->new($s)->can_read(0.1), 'limit_req different key'); |
84 | 84 |
85 # limit_conn tests | 85 # limit_conn tests |
86 | 86 |
87 $s = http_get('/w', start => 1); | 87 $s = http_get('/w', start => 1); |
88 select undef, undef, undef, 0.2; | |
88 | 89 |
89 like(http_get('/'), qr/^HTTP\/1.. 503 /, 'limit_conn same key'); | 90 like(http_get('/'), qr/^HTTP\/1.. 503 /, 'limit_conn same key'); |
90 unlike(http_get('/?c=2'), qr/^HTTP\/1.. 503 /, 'limit_conn different key'); | 91 unlike(http_get('/?c=2'), qr/^HTTP\/1.. 503 /, 'limit_conn different key'); |
91 | 92 |
92 ############################################################################### | 93 ############################################################################### |