summaryrefslogtreecommitdiff
path: root/t/expirations.t
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2017-07-26 15:08:48 -0700
committerdormando <dormando@rydia.net>2017-07-26 15:08:48 -0700
commitc1e854a836179e2095bde1180f7e8ebfa0976f78 (patch)
tree3809c1c16e9671daaeaad3095878028669e4f215 /t/expirations.t
parent24ca3d89b0e3fd2e4a11301ae3f37ee872567620 (diff)
downloadmemcached-c1e854a836179e2095bde1180f7e8ebfa0976f78.tar.gz
default to unix sockets for tests
Tests have randomly failed to start since the beginning of time, due largely to port assignment. A random local port is tested, then passed onto the daemon to try. If that port (on 0.0.0.0) becomes used in the meantime, it fails. Now, tests default to using unix sockets unique to the pid of the test parent. Some tests still run via the network and have been changed to 127.0.0.1, which should collide less with normal internet connections. Some tests require that due to some timing issues that unix sockets seem to create, and others expect a network in a few cases. Ran the tests with `PARALLEL=9 make test` on my machine for two hours and they didn't fail once.
Diffstat (limited to 't/expirations.t')
-rwxr-xr-xt/expirations.t4
1 files changed, 2 insertions, 2 deletions
diff --git a/t/expirations.t b/t/expirations.t
index c92125a..47300cb 100755
--- a/t/expirations.t
+++ b/t/expirations.t
@@ -28,11 +28,11 @@ sub wait_for_early_second {
wait_for_early_second();
-print $sock "set foo 0 1 6\r\nfooval\r\n";
+print $sock "set foo 0 3 6\r\nfooval\r\n";
is(scalar <$sock>, "STORED\r\n", "stored foo");
mem_get_is($sock, "foo", "fooval");
-sleep(1.5);
+sleep(4);
mem_get_is($sock, "foo", undef);
$expire = time() - 1;