summaryrefslogtreecommitdiff
path: root/t/lru-maintainer.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/lru-maintainer.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/lru-maintainer.t')
-rw-r--r--t/lru-maintainer.t4
1 files changed, 2 insertions, 2 deletions
diff --git a/t/lru-maintainer.t b/t/lru-maintainer.t
index 63b1c27..ac2ba7b 100644
--- a/t/lru-maintainer.t
+++ b/t/lru-maintainer.t
@@ -9,7 +9,7 @@ use MemcachedTest;
# Regression test for underestimating the size of items after the large memory
# change.
-my $server = new_memcached('-m 3 -o lru_maintainer,lru_crawler');
+my $server = new_memcached('-m 3 -o lru_maintainer,lru_crawler -l 127.0.0.1');
my $sock = $server->sock;
my $keystub = "X"x200;
for (1 .. 15000) {
@@ -21,7 +21,7 @@ print $sock "set $keystub 0 0 2\r\nok\r\n";
is(scalar <$sock>, "STORED\r\n", "stored key without OOM");
# Basic tests
-$server = new_memcached('-m 6 -o lru_maintainer,lru_crawler');
+$server = new_memcached('-m 6 -o lru_maintainer,lru_crawler -l 127.0.0.1');
$sock = $server->sock;
for (1 .. 10) {