Tomash Brechko wrote:
On Thu, Dec 06, 2007 at 12:40:28 -0800, dormando wrote:
Those tests ended up being nondeterministic. I had a report of someone
running a VM with very little memory allocated to it, and the tests
failed with the results flipped. If he allocated more memory, they
flipped back.
In looking at it, I can only see it working if you do something to
ensure memcached received the first command before the second one...
Otherwise tcp magic could get them flipped.
Got it. Didn't notice two different sockets at first, yes, nothing
enforces the order of two commands.
Then this piece:
print $sock "cas foo1 0 0 6 $result[0]\r\nbarva2\r\n";
print $sock2 "cas foo1 0 0 5 $result2[0]\r\napple\r\n";
is(scalar <$sock>, "STORED\r\n", "cas success, set foo1");
is(scalar <$sock2>, "EXISTS\r\n", "cas failed for foo1");
should probably be
print $sock "cas foo1 0 0 6 $result[0]\r\nbarva2\r\n";
print $sock2 "cas foo1 0 0 5 $result2[0]\r\napple\r\n";
my $res1 = scalar <$sock>;
my $res2 = scalar <$sock2>;
ok(($res1 eq "STORED\r\n" and $res2 eq "EXISTS\r\n") or
($res1 eq "EXISTS\r\n" and $res2 eq "STORED\r\n"));
So this is testing ... cas failure?