[memcached] bradfitz, r347: test flush_all in future

commits at code.sixapart.com commits at code.sixapart.com
Mon Sep 4 06:38:02 UTC 2006


test flush_all in future

U   trunk/server/test/flush-all.t


Modified: trunk/server/test/flush-all.t
===================================================================
--- trunk/server/test/flush-all.t	2006-09-04 06:33:36 UTC (rev 346)
+++ trunk/server/test/flush-all.t	2006-09-04 06:38:02 UTC (rev 347)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 
 use strict;
-use Test::More tests => 7;
+use Test::More tests => 11;
 use FindBin qw($Bin);
 use lib "$Bin/lib";
 use MemcachedTest;
@@ -10,7 +10,7 @@
 my $sock = $server->sock;
 my $expire;
 
-print $sock "set foo 0 1 6\r\nfooval\r\n";
+print $sock "set foo 0 0 6\r\nfooval\r\n";
 is(scalar <$sock>, "STORED\r\n", "stored foo");
 
 mem_get_is($sock, "foo", "fooval");
@@ -21,7 +21,7 @@
 SKIP: {
     skip "flush_all is still only second-granularity.  need atomic counter on flush_all.", 2 unless 0;
 
-    print $sock "set foo 0 1 3\r\nnew\r\n";
+    print $sock "set foo 0 0 3\r\nnew\r\n";
     is(scalar <$sock>, "STORED\r\n", "stored foo = 'new'");
     mem_get_is($sock, "foo", 'new');
 }
@@ -29,3 +29,13 @@
 sleep 1;
 mem_get_is($sock, "foo", undef);
 
+# and the other form, specifying a flush_all time...
+my $expire = time() + 2;
+print $sock "flush_all $expire\r\n";
+is(scalar <$sock>, "OK\r\n", "did flush_all in future");
+
+print $sock "set foo 0 0 4\r\n1234\r\n";
+is(scalar <$sock>, "STORED\r\n", "stored foo = '1234'");
+mem_get_is($sock, "foo", '1234');
+sleep(2.2);
+mem_get_is($sock, "foo", undef);




More information about the memcached-commits mailing list