comparison stream_upstream_least_conn.t @ 566:4296379213c8

Tests: refactored stream least_conn tests similar to e4ff43e00d84.
author Sergey Kandaurov <pluknet@nginx.com>
date Wed, 29 Apr 2015 15:53:58 +0300
parents ff49e1c00b35
children 824754da4afc
comparison
equal deleted inserted replaced
565:ff49e1c00b35 566:4296379213c8
57 $t->waitforsocket('127.0.0.1:8082'); 57 $t->waitforsocket('127.0.0.1:8082');
58 58
59 ############################################################################### 59 ###############################################################################
60 60
61 is(many('.', 10), '8081: 5, 8082: 5', 'balanced'); 61 is(many('.', 10), '8081: 5, 8082: 5', 'balanced');
62 is(parallel('w', 10), '8081: 1, 8082: 9', 'least_conn'); 62
63 my @sockets;
64 for (1 .. 2) {
65 my $s = stream_connect();
66 stream_write($s, 'w');
67 push @sockets, $s;
68 }
69
70 select undef, undef, undef, 0.2;
71
72 is(many('.', 10), '8082: 10', 'least_conn');
63 73
64 ############################################################################### 74 ###############################################################################
65 75
66 sub many { 76 sub many {
67 my ($data, $count, %opts) = @_; 77 my ($data, $count, %opts) = @_;