diff options
author | dormando <dormando@rydia.net> | 2015-04-25 01:00:35 -0700 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2015-04-25 01:00:35 -0700 |
commit | 5ddccfe02e57e56defe3e835e5bdac3eae43e6bb (patch) | |
tree | 25a6197f2246bba29c641b1e687769a77d090df6 | |
parent | 369845f086fd1e31481aca656cb9131a883a86a9 (diff) | |
download | memcached-5ddccfe02e57e56defe3e835e5bdac3eae43e6bb.tar.gz |
relax timing glitch in the lru maintainer test
This test is requiring that the juggler thread runs at all before the stats
check happens. I've tried running this under an rPi1 and can't reproduce the
race, but for some reason solaris amd64 does. This is likely due to the usleep
not working as expected.
Unfortunately I don't have direct access to a solaris host, so this is the
best I can do for now. The juggler does eventually wake up so I'm unconcerned.
-rw-r--r-- | t/lru-maintainer.t | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/t/lru-maintainer.t b/t/lru-maintainer.t index f3648f4..d971206 100644 --- a/t/lru-maintainer.t +++ b/t/lru-maintainer.t @@ -29,7 +29,14 @@ is(scalar <$sock>, "STORED\r\n", "stored canary key"); # Now flush the slab class with junk. for (my $key = 0; $key < 100; $key++) { if ($key == 30) { - my $stats = mem_stats($sock, "items"); + my $stats; + for (0..2) { + # Give the juggler some time to move. some platforms suffer at + # this more than others (solaris amd64?) + $stats = mem_stats($sock, "items"); + if ($stats->{"items:31:moves_to_cold"} == 0) { sleep 1; next; } + last; + } isnt($stats->{"items:31:moves_to_cold"}, 0, "moved some items to cold"); # Fetch the canary once, so it's now marked as active. mem_get_is($sock, "canary", $value); |