changeset 587:c0b4ae82fd9d

Tests: adjusted memcached test timeouts. Raised Cache::Memcached connect_timeout from the default value.
author Sergey Kandaurov <pluknet@nginx.com>
date Mon, 25 May 2015 14:21:18 +0300
parents ef2b435c1048
children 53b7c3c33a79
files gunzip_memcached.t memcached.t memcached_keepalive.t memcached_keepalive_stale.t upstream_hash_memcached.t
diffstat 5 files changed, 15 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- 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: $!";
 
--- 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: $!";
 
--- 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');
--- 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
--- 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: $!";