Subject: | t/05_reconnect_timeout.t fails if no memcache instance is started |
t/05_reconnect_timeout.t fails for me if no memcache instance has been
started. I looked into the different other tests about the skipping
section and introduced it to t/05-* as well.
Could you check the attached patch if it's correct and add this to the
module if its useful?
Thanks in advance
Rhaen
Subject: | Cache-Memcached.patch |
diff -Naur Cache-Memcached-1.27/t/05_reconnect_timeout.t Cache-Memcached-1.27.patch/t/05_reconnect_timeout.t
--- Cache-Memcached-1.27/t/05_reconnect_timeout.t 2009-05-03 05:17:30.000000000 +0200
+++ Cache-Memcached-1.27.patch/t/05_reconnect_timeout.t 2009-10-08 08:00:49.000000000 +0200
@@ -6,9 +6,19 @@
use IO::Socket::INET;
use Time::HiRes;
-my $testaddr = "192.0.2.1:11211";
-plan tests => 2;
+
+
+
+my $testaddr = "127.0.0.1:11211";
+my $msock = IO::Socket::INET->new(PeerAddr => $testaddr,
+ Timeout => 3);
+if ($msock) {
+ plan tests => 2;
+} else {
+ plan skip_all => "No memcached instance running at $testaddr\n";
+ exit 0;
+}
my $memd = Cache::Memcached->new({
servers => [ $testaddr ],