diff lib/Test/Nginx/Stream.pm @ 969:1edb092149e2

Tests: simplified parallel tests. Now configurations are automatically scanned for "127.0.0.1:8xxx", and ports are auto-replaced by free ones. The exact port specified is used if it's free.
author Maxim Dounin <mdounin@mdounin.ru>
date Fri, 08 Jul 2016 02:21:14 +0300
parents 9361c7eddfc1
children 91e64c1ceec9
line wrap: on
line diff
--- a/lib/Test/Nginx/Stream.pm
+++ b/lib/Test/Nginx/Stream.pm
@@ -41,7 +41,7 @@ sub new {
 	$self->{_socket} = IO::Socket::INET->new(
 		Proto => "tcp",
 		PeerAddr => '127.0.0.1',
-		PeerPort => ($Test::Nginx::ports[0]{port} || 8080),
+		PeerPort => port(8080),
 		@_
 	)
 		or die "Can't connect to nginx: $!\n";