Mercurial > hg > ngx_http_upstream_keepalive
comparison t/memcached-keepalive.t @ 12:067ddc059ee0
Keepalive: fix tests to be compatible with repcached patches.
And add waitforsocket() calls to avoid startup races.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Wed, 19 Nov 2008 22:23:21 +0300 |
parents | 15530a464dba |
children | 181a487581b7 |
comparison
equal
deleted
inserted
replaced
11:15530a464dba | 12:067ddc059ee0 |
---|---|
92 } | 92 } |
93 } | 93 } |
94 | 94 |
95 EOF | 95 EOF |
96 | 96 |
97 $t->run_daemon('memcached', '-l', '127.0.0.1', '-p', '8081'); | 97 if (`memcached -h` =~ /repcached/) { |
98 $t->run_daemon('memcached', '-l', '127.0.0.1', '-p', '8082'); | 98 # repcached patches adds additional listen socket memcached |
99 # that should be different too | |
100 | |
101 $t->run_daemon('memcached', '-l', '127.0.0.1', '-p', '8081', | |
102 '-X', '8091'); | |
103 $t->run_daemon('memcached', '-l', '127.0.0.1', '-p', '8082', | |
104 '-X', '8092'); | |
105 | |
106 } else { | |
107 $t->run_daemon('memcached', '-l', '127.0.0.1', '-p', '8081'); | |
108 $t->run_daemon('memcached', '-l', '127.0.0.1', '-p', '8082'); | |
109 } | |
110 | |
99 $t->run(); | 111 $t->run(); |
112 | |
113 $t->waitforsocket('127.0.0.1:8081') | |
114 or die "Unable to start memcached"; | |
115 $t->waitforsocket('127.0.0.1:8082') | |
116 or die "Unable to start second memcached"; | |
100 | 117 |
101 ############################################################################### | 118 ############################################################################### |
102 | 119 |
103 my $memd1 = Cache::Memcached->new(servers => [ '127.0.0.1:8081' ]); | 120 my $memd1 = Cache::Memcached->new(servers => [ '127.0.0.1:8081' ]); |
104 my $memd2 = Cache::Memcached->new(servers => [ '127.0.0.1:8082' ]); | 121 my $memd2 = Cache::Memcached->new(servers => [ '127.0.0.1:8082' ]); |