Mercurial > hg > nginx-tests
diff upstream.t @ 293:719285b89d7e
Tests: upstream.t minor fixes.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Sat, 08 Jun 2013 02:38:50 +0400 |
parents | ba5b92378653 |
children | a9621dbbd0d4 |
line wrap: on
line diff
--- a/upstream.t Fri May 31 20:26:31 2013 +0400 +++ b/upstream.t Sat Jun 08 02:38:50 2013 +0400 @@ -64,6 +64,9 @@ $t->run_daemon(\&http_daemon, 8082); $t->run(); +$t->waitforsocket('127.0.0.1:8081'); +$t->waitforsocket('127.0.0.1:8082'); + ############################################################################### is(many('/', 30), '8081: 15, 8082: 15', 'balanced'); @@ -94,7 +97,7 @@ my ($uri, $count, %opts) = @_; my %ports; - for (1 .. 30) { + for (1 .. $count) { if (http_get($uri) =~ /X-Port: (\d+)/) { $ports{$1} = 0 unless defined $ports{$1}; $ports{$1}++; @@ -121,6 +124,8 @@ ) or die "Can't create listening socket: $!\n"; + local $SIG{PIPE} = 'IGNORE'; + while (my $client = $server->accept()) { $client->autoflush(1);