diff proxy_next_upstream.t @ 952:e9064d691790

Tests: converted tests to run in parallel.
author Andrey Zelenkov <zelenkov@nginx.com>
date Tue, 21 Jun 2016 16:39:13 +0300
parents 3d3c8b5ea8ee
children 882267679006
line wrap: on
line diff
--- a/proxy_next_upstream.t
+++ b/proxy_next_upstream.t
@@ -36,17 +36,17 @@ http {
     %%TEST_GLOBALS_HTTP%%
 
     upstream u {
-        server 127.0.0.1:8081;
-        server 127.0.0.1:8082;
+        server 127.0.0.1:%%PORT_1%%;
+        server 127.0.0.1:%%PORT_2%%;
     }
 
     upstream u2 {
-        server 127.0.0.1:8081;
-        server 127.0.0.1:8082;
+        server 127.0.0.1:%%PORT_1%%;
+        server 127.0.0.1:%%PORT_2%%;
     }
 
     server {
-        listen       127.0.0.1:8080;
+        listen       127.0.0.1:%%PORT_0%%;
         server_name  localhost;
 
         location / {
@@ -67,7 +67,7 @@ http {
     }
 
     server {
-        listen       127.0.0.1:8081;
+        listen       127.0.0.1:%%PORT_1%%;
         server_name  localhost;
 
         location / {
@@ -86,7 +86,7 @@ http {
     }
 
     server {
-        listen       127.0.0.1:8082;
+        listen       127.0.0.1:%%PORT_2%%;
         server_name  localhost;
 
         location / {
@@ -105,6 +105,8 @@ EOF
 
 ###############################################################################
 
+my ($p1, $p2) = (port(1), port(2));
+
 # check if both request fallback to a backend
 # which returns valid response
 
@@ -128,7 +130,7 @@ unlike(http_get('/ok') . http_get('/ok')
 # make sure all backends are tried once
 
 like(http_get('/all/rr'),
-	qr/^127.0.0.1:808(1, 127.0.0.1:8082|2, 127.0.0.1:8081)$/mi,
+	qr/^127.0.0.1:($p1, 127.0.0.1:$p2|$p2, 127.0.0.1:$p1)$/mi,
 	'all tried once');
 
 ###############################################################################