# HG changeset patch # User Sergey Kandaurov # Date 1415362278 -10800 # Node ID d456ed8a18dec17741570a9502b1cbccff352bea # Parent 799487ee9aeea8314ac2c707e691e74595cb9e41 Tests: added proxy_next_upstream_tries.t tests with zero value. diff --git a/proxy_next_upstream_tries.t b/proxy_next_upstream_tries.t --- a/proxy_next_upstream_tries.t +++ b/proxy_next_upstream_tries.t @@ -87,6 +87,11 @@ http { proxy_next_upstream_tries 2; } + location /tries/zero { + proxy_pass http://u; + proxy_next_upstream_tries 0; + } + location /timeout { proxy_pass http://u3; proxy_next_upstream_timeout 1900ms; @@ -105,6 +110,11 @@ http { proxy_next_upstream_timeout 1900ms; } + location /timeout/zero { + proxy_pass http://u3; + proxy_next_upstream_timeout 0; + } + location /404 { return 200 x${upstream_status}x; } @@ -116,7 +126,7 @@ EOF $t->run_daemon(\&http_daemon, 8081); $t->run_daemon(\&http_daemon, 8082); $t->run_daemon(\&dns_daemon, 8083, $t); -$t->try_run('no proxy_next_upstream_tries')->plan(6); +$t->try_run('no proxy_next_upstream_tries')->plan(8); $t->waitforsocket('127.0.0.1:8081'); $t->waitforsocket('127.0.0.1:8082'); @@ -134,6 +144,8 @@ like(http_get('/tries/resolver'), qr/x40 } +like(http_get('/tries/zero'), qr/x404, 404, 404x/, 'tries zero'); + # two tries fit into 1.9s like(http_get('/timeout'), qr/x404, 404x/, 'timeout'); @@ -146,6 +158,8 @@ like(http_get('/timeout/resolver'), qr/x } +like(http_get('/timeout/zero'), qr/x404, 404, 404x/, 'timeout zero'); + ############################################################################### sub http_daemon {