summaryrefslogtreecommitdiff
path: root/t/expirations.t
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2020-03-10 17:04:04 -0700
committerdormando <dormando@rydia.net>2020-03-10 17:04:04 -0700
commitf162a5ceebb6550bfa44a28643491b806fd5b5a1 (patch)
tree5cd603c546af2ef474be4f778962a9e157216cb3 /t/expirations.t
parent15aae94eaed4f0655148ab9ba129cd5fd73c4e30 (diff)
downloadmemcached-f162a5ceebb6550bfa44a28643491b806fd5b5a1.tar.gz
flaky test fix: t/expirations.t
Not really fixing this; need some infrastructure to halt then force the clock to specific times. Cranking the times should reduce the flakiness; if it doesn't we'll set them to SKIP:
Diffstat (limited to 't/expirations.t')
-rwxr-xr-xt/expirations.t7
1 files changed, 4 insertions, 3 deletions
diff --git a/t/expirations.t b/t/expirations.t
index 47300cb..7b5aaec 100755
--- a/t/expirations.t
+++ b/t/expirations.t
@@ -40,11 +40,12 @@ 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");
-$expire = time() + 1;
+# TODO: These suck. We really need a time travel command like 1.5 had.
+$expire = time() + 4;
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(2.2);
+sleep(8);
mem_get_is($sock, "foo", undef, "now expired");
$expire = time() - 20;
@@ -58,7 +59,7 @@ mem_get_is($sock, "add", "addval");
# second add fails
print $sock "add add 0 2 7\r\naddval2\r\n";
is(scalar <$sock>, "NOT_STORED\r\n", "add failure");
-sleep(2.3);
+sleep(5);
print $sock "add add 0 2 7\r\naddval3\r\n";
is(scalar <$sock>, "STORED\r\n", "stored add again");
mem_get_is($sock, "add", "addval3");