From: Vincent Pit Date: Tue, 21 Jul 2015 15:09:57 +0000 (-0300) Subject: Simplify the timeout logic in t/09-load-threads.t X-Git-Tag: v0.58~2 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=0aba0d53f2d474b5ae53796000cc42b666d3983e;p=perl%2Fmodules%2FVariable-Magic.git Simplify the timeout logic in t/09-load-threads.t The old loop could actually never be executed more than one iteration. A real good implementation would check whether any of the peers has exited, but it would involve much more work. --- diff --git a/t/09-load-threads.t b/t/09-load-threads.t index 65a5d2d..60d6acf 100644 --- a/t/09-load-threads.t +++ b/t/09-load-threads.t @@ -178,14 +178,12 @@ sub sync_master { LOCK: { lock $locks_up[$id]; - for (1 .. 100) { - my $timeout = time() + 2; - until ($locks_up[$id] == $peers) { - if (cond_timedwait $locks_up[$id], $timeout) { - last LOCK; - } else { - return 0; - } + my $timeout = time() + 10; + until ($locks_up[$id] == $peers) { + if (cond_timedwait $locks_up[$id], $timeout) { + last LOCK; + } else { + return 0; } } }