Mercurial > hg > nginx-tests
comparison http_resolver.t @ 678:99233cfefbbe
Tests: adjusted test timeouts.
Made tests pass on hosts with moderately unstable system clock.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Mon, 07 Sep 2015 14:09:51 +0300 |
parents | a04b8b9537cd |
children | a6764c2a9f12 |
comparison
equal
deleted
inserted
replaced
677:5d258aa5ebc5 | 678:99233cfefbbe |
---|---|
53 location /two { | 53 location /two { |
54 resolver 127.0.0.1:8081 127.0.0.1:8082; | 54 resolver 127.0.0.1:8081 127.0.0.1:8082; |
55 proxy_pass http://$host:8080/backend; | 55 proxy_pass http://$host:8080/backend; |
56 } | 56 } |
57 location /valid { | 57 location /valid { |
58 resolver 127.0.0.1:8081 valid=3s; | 58 resolver 127.0.0.1:8081 valid=5s; |
59 proxy_pass http://$host:8080/backend; | 59 proxy_pass http://$host:8080/backend; |
60 } | 60 } |
61 location /case { | 61 location /case { |
62 resolver 127.0.0.1:8081; | 62 resolver 127.0.0.1:8081; |
63 proxy_pass http://$http_x_name:8080/backend; | 63 proxy_pass http://$http_x_name:8080/backend; |
206 # response is taken from cache | 206 # response is taken from cache |
207 | 207 |
208 like(http_host_header('ttl.example.net', '/valid'), qr/200 OK/, | 208 like(http_host_header('ttl.example.net', '/valid'), qr/200 OK/, |
209 'valid overrides ttl'); | 209 'valid overrides ttl'); |
210 | 210 |
211 sleep 2; | 211 sleep 4; |
212 | 212 |
213 # expired "valid" value causes nginx to make actual query | 213 # expired "valid" value causes nginx to make actual query |
214 | 214 |
215 like(http_host_header('ttl.example.net', '/valid'), qr/502 Bad/, | 215 like(http_host_header('ttl.example.net', '/valid'), qr/502 Bad/, |
216 'valid expired'); | 216 'valid expired'); |