From 27aad8a31de0f67b4d9a413b706e8d551b21977c Mon Sep 17 00:00:00 2001 From: "Jerry D. Hedden" Date: Thu, 22 Mar 2007 00:34:23 -0700 Subject: [PATCH] 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 --- ext/threads/shared/t/waithires.t | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) 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"); } } } -- 1.8.3.1