# HG changeset patch # User Maxim Dounin # Date 1227122601 -10800 # Node ID 067ddc059ee0336d6b9da2a5d4771ddeb03b3f30 # Parent 15530a464dba5ab9adae1595eb2fe8340ab4293e Keepalive: fix tests to be compatible with repcached patches. And add waitforsocket() calls to avoid startup races. diff --git a/t/memcached-keepalive.t b/t/memcached-keepalive.t --- a/t/memcached-keepalive.t +++ b/t/memcached-keepalive.t @@ -94,10 +94,27 @@ http { EOF -$t->run_daemon('memcached', '-l', '127.0.0.1', '-p', '8081'); -$t->run_daemon('memcached', '-l', '127.0.0.1', '-p', '8082'); +if (`memcached -h` =~ /repcached/) { + # repcached patches adds additional listen socket memcached + # that should be different too + + $t->run_daemon('memcached', '-l', '127.0.0.1', '-p', '8081', + '-X', '8091'); + $t->run_daemon('memcached', '-l', '127.0.0.1', '-p', '8082', + '-X', '8092'); + +} else { + $t->run_daemon('memcached', '-l', '127.0.0.1', '-p', '8081'); + $t->run_daemon('memcached', '-l', '127.0.0.1', '-p', '8082'); +} + $t->run(); +$t->waitforsocket('127.0.0.1:8081') + or die "Unable to start memcached"; +$t->waitforsocket('127.0.0.1:8082') + or die "Unable to start second memcached"; + ############################################################################### my $memd1 = Cache::Memcached->new(servers => [ '127.0.0.1:8081' ]);