[memcached] bradfitz, r350: test was racy before. increased margins...

commits at code.sixapart.com commits at code.sixapart.com
Mon Sep 4 07:21:13 UTC 2006

test was racy before.  increased margins.  this version ran in a loop
for a long time... race should be gone.

there's theory for minimum time thing should take (hitting both OS
process scheduling, and the 1 second time-updating event in memcached...)

U   trunk/server/test/expirations.t

Modified: trunk/server/test/expirations.t
--- trunk/server/test/expirations.t	2006-09-04 07:15:22 UTC (rev 349)
+++ trunk/server/test/expirations.t	2006-09-04 07:21:12 UTC (rev 350)
@@ -14,10 +14,10 @@
 is(scalar <$sock>, "STORED\r\n", "stored foo");
 mem_get_is($sock, "foo", "fooval");
 mem_get_is($sock, "foo", undef);
-$expire = time();
+$expire = time() - 1;
 print $sock "set foo 0 $expire 6\r\nfooval\r\n";
 is(scalar <$sock>, "STORED\r\n", "stored foo");
 mem_get_is($sock, "foo", undef, "already expired");
@@ -26,6 +26,6 @@
 print $sock "set foo 0 $expire 6\r\nfoov+1\r\n";
 is(scalar <$sock>, "STORED\r\n", "stored foo");
 mem_get_is($sock, "foo", "foov+1");
-sleep 1;
 mem_get_is($sock, "foo", undef, "now expired");

More information about the memcached-commits mailing list