From: Jerry D. Hedden Date: Thu, 22 Mar 2007 07:34:23 +0000 (-0700) Subject: Fix to threads::shared t/waithires.t X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=27aad8a31de0f67b4d9a413b706e8d551b21977c;p=p5sagit%2Fp5-mst-13.2.git Fix to threads::shared t/waithires.t From: "Jerry D. Hedden" Message-ID: <381102.32342.qm@web30207.mail.mud.yahoo.com> p4raw-id: //depot/perl@30687 --- diff --git a/ext/threads/shared/t/waithires.t b/ext/threads/shared/t/waithires.t index a89323d..8620ab5 100644 --- a/ext/threads/shared/t/waithires.t +++ b/ext/threads/shared/t/waithires.t @@ -205,18 +205,12 @@ SYNC_SHARED: { die "$test: unknown test\n"; } $delta = time() - $delta; - if (($to < 0) || ($^O eq 'os2')) { - ok(2, ! defined($ok), "$test: timeout"); - } else { - # This is a bit problematic, as scheduling and compute latencies - # can inject delays in our computation. For now, assume -10/+20% - # is reasonable - if (! ok(2, ! defined($ok) && - ($delta > (0.9 * $to)) && - ($delta < (1.2 * $to)), - "$test: timeout")) - { - print(STDERR "# Timeout: specified=$to actual=$delta secs.\n"); + ok(2, ! defined($ok), "$test: timeout"); + + if (($to > 0) && ($^O ne 'os2')) { + # Timing tests can be problematic + if (($delta < (0.9 * $to)) || ($delta > (1.0 + $to))) { + print(STDERR "# Timeout: specified=$to actual=$delta secs.\n"); } } } @@ -322,14 +316,12 @@ SYNCH_REFS: { die "$test: unknown test\n"; } $delta = time() - $delta; - if (($to < 0) || ($^O eq 'os2')) { - ok(2,!$ok, "$test: timeout"); - } else { - if (ok(2, ! $ok, "$test: timeout")) { - # Timing tests can be problematic - if (($delta < (0.9 * $to)) || ($delta > (1.0 + $to))) { - print(STDERR "# Timeout: specified=$to actual=$delta secs.\n"); - } + ok(2, ! $ok, "$test: timeout"); + + if (($to > 0) && ($^O ne 'os2')) { + # Timing tests can be problematic + if (($delta < (0.9 * $to)) || ($delta > (1.0 + $to))) { + print(STDERR "# Timeout: specified=$to actual=$delta secs.\n"); } } }