# HG changeset patch # User Sergey Kandaurov # Date 1434476362 -10800 # Node ID ef1c363dd6486173c669181f31a5cd8a242bd033 # Parent 97e88eff14338e724caa3472c1cf150274d68199 Tests: adjusted proxy_next_upstream_tries.t test timeouts. As a result, timeout tests are now skipped by default as too long to execute. 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 @@ -81,21 +81,21 @@ http { } location /timeout { - proxy_pass http://u/w; - proxy_next_upstream_timeout 1900ms; + proxy_pass http://u/w2; + proxy_next_upstream_timeout 3800ms; } location /timeout/backup { - proxy_pass http://u2/w; - proxy_next_upstream_timeout 1900ms; + proxy_pass http://u2/w2; + proxy_next_upstream_timeout 3800ms; } location /timeout/resolver { resolver 127.0.0.1:8083; resolver_timeout 1s; - proxy_pass http://$host:8081/w; - proxy_next_upstream_timeout 1900ms; + proxy_pass http://$host:8081/w2; + proxy_next_upstream_timeout 3800ms; } location /timeout/zero { @@ -127,11 +127,16 @@ like(http_get('/tries/zero'), qr/x404, 4 # two tries fit into 1.9s +SKIP: { +skip 'long tests', 4 unless $ENV{TEST_NGINX_UNSAFE}; + like(http_get('/timeout'), qr/x404, 404x/, 'timeout'); like(http_get('/timeout/backup'), qr/x404, 404x/, 'timeout backup'); like(http_get('/timeout/resolver'), qr/x404, 404x/, 'timeout resolved'); like(http_get('/timeout/zero'), qr/x404, 404, 404x/, 'timeout zero'); +} + ############################################################################### sub http_daemon { @@ -168,6 +173,11 @@ sub http_daemon { select undef, undef, undef, 1; } + if ($uri eq '/w2') { + Test::Nginx::log_core('||', "$port: sleep(2)"); + select undef, undef, undef, 2; + } + Test::Nginx::log_core('||', "$port: response, 404"); print $client <