summaryrefslogtreecommitdiff
path: root/t/flush-all.t
diff options
context:
space:
mode:
authorSteven Grimm <sgrimm@facebook.com>2006-11-20 21:16:56 +0000
committerSteven Grimm <sgrimm@facebook.com>2006-11-20 21:16:56 +0000
commitc5944dc2b4bdf5c94448466884f06f26d403baf4 (patch)
tree0a7a3658fe1b258ee3c77ca6d5ebf2b3ccbea456 /t/flush-all.t
parent4d6163996b24e2dd0a6a01387d16af3fdd8bee40 (diff)
downloadmemcached-c5944dc2b4bdf5c94448466884f06f26d403baf4.tar.gz
Fix for flush_all 1-second window bug. You can now do a "set" immediately
after a "flush_all" without the newly set data getting expired. git-svn-id: http://code.sixapart.com/svn/memcached/trunk/server@436 b0b603af-a30f-0410-a34e-baf09ae79d0b
Diffstat (limited to 't/flush-all.t')
-rwxr-xr-xt/flush-all.t16
1 files changed, 5 insertions, 11 deletions
diff --git a/t/flush-all.t b/t/flush-all.t
index f3b5c2d..4f806c9 100755
--- a/t/flush-all.t
+++ b/t/flush-all.t
@@ -1,7 +1,7 @@
#!/usr/bin/perl
use strict;
-use Test::More tests => 11;
+use Test::More tests => 10;
use FindBin qw($Bin);
use lib "$Bin/lib";
use MemcachedTest;
@@ -16,18 +16,12 @@ is(scalar <$sock>, "STORED\r\n", "stored foo");
mem_get_is($sock, "foo", "fooval");
print $sock "flush_all\r\n";
is(scalar <$sock>, "OK\r\n", "did flush_all");
-
mem_get_is($sock, "foo", undef);
-SKIP: {
- skip "flush_all is still only second-granularity. need atomic counter on flush_all.", 2 unless 0;
-
- 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');
-}
-sleep 1;
-mem_get_is($sock, "foo", undef);
+# check that flush_all doesn't blow away items that immediately get set
+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');
# and the other form, specifying a flush_all time...
my $expire = time() + 2;