# HG changeset patch # User Sergey Kandaurov # Date 1432552878 -10800 # Node ID c0b4ae82fd9d761691a536e4efca30cc9541781e # Parent ef2b435c1048b8726e82645674b9160e5cc202d4 Tests: adjusted memcached test timeouts. Raised Cache::Memcached connect_timeout from the default value. diff --git a/gunzip_memcached.t b/gunzip_memcached.t --- a/gunzip_memcached.t +++ b/gunzip_memcached.t @@ -80,7 +80,7 @@ if ($memhelp =~ /-U/) { # set and compressed value to be at least 20% less than original one. my $memd = Cache::Memcached->new(servers => [ '127.0.0.1:8081' ], - compress_threshold => 1); + compress_threshold => 1, connect_timeout => 1.0); $memd->set('/', 'TEST' x 10) or die "can't put value into memcached: $!"; diff --git a/memcached.t b/memcached.t --- a/memcached.t +++ b/memcached.t @@ -77,7 +77,8 @@ if ($memhelp =~ /-U/) { ############################################################################### -my $memd = Cache::Memcached->new(servers => [ '127.0.0.1:8081' ]); +my $memd = Cache::Memcached->new(servers => [ '127.0.0.1:8081' ], + connect_timeout => 1.0); $memd->set('/', 'SEE-THIS') or die "can't put value into memcached: $!"; diff --git a/memcached_keepalive.t b/memcached_keepalive.t --- a/memcached_keepalive.t +++ b/memcached_keepalive.t @@ -120,8 +120,10 @@ if ($memhelp =~ /-t/) { ############################################################################### -my $memd1 = Cache::Memcached->new(servers => [ '127.0.0.1:8081' ]); -my $memd2 = Cache::Memcached->new(servers => [ '127.0.0.1:8082' ]); +my $memd1 = Cache::Memcached->new(servers => [ '127.0.0.1:8081' ], + connect_timeout => 1.0); +my $memd2 = Cache::Memcached->new(servers => [ '127.0.0.1:8082' ], + connect_timeout => 1.0); $memd1->set('/', 'SEE-THIS'); $memd2->set('/', 'SEE-THIS'); diff --git a/memcached_keepalive_stale.t b/memcached_keepalive_stale.t --- a/memcached_keepalive_stale.t +++ b/memcached_keepalive_stale.t @@ -87,7 +87,8 @@ if ($memhelp =~ /-t/) { ############################################################################### -my $memd1 = Cache::Memcached->new(servers => [ '127.0.0.1:8081' ]); +my $memd1 = Cache::Memcached->new(servers => [ '127.0.0.1:8081' ], + connect_timeout => 1.0); # It's possible that stale events occur, i.e. read event handler called # for just saved upstream connection without any data available for diff --git a/upstream_hash_memcached.t b/upstream_hash_memcached.t --- a/upstream_hash_memcached.t +++ b/upstream_hash_memcached.t @@ -119,9 +119,12 @@ if ($memhelp =~ /-U/) { ############################################################################### -my $memd1 = Cache::Memcached->new(servers => [ '127.0.0.1:8081' ]); -my $memd2 = Cache::Memcached->new(servers => [ '127.0.0.1:8082' ]); -my $memd3 = Cache::Memcached->new(servers => [ '127.0.0.1:8083' ]); +my $memd1 = Cache::Memcached->new(servers => [ '127.0.0.1:8081' ], + connect_timeout => 1.0); +my $memd2 = Cache::Memcached->new(servers => [ '127.0.0.1:8082' ], + connect_timeout => 1.0); +my $memd3 = Cache::Memcached->new(servers => [ '127.0.0.1:8083' ], + connect_timeout => 1.0); for my $i (1 .. 20) { $memd1->set($i, '8081') or die "can't put value into memcached: $!";