changeset 608:ef1c363dd648

Tests: adjusted proxy_next_upstream_tries.t test timeouts. As a result, timeout tests are now skipped by default as too long to execute.
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 16 Jun 2015 20:39:22 +0300
parents 97e88eff1433
children 9310443c0bd3
files proxy_next_upstream_tries.t
diffstat 1 files changed, 16 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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 <<EOF;
 HTTP/1.1 404 Not Found