diff options
author | Jerry D. Hedden <jdhedden@cpan.org> | 2007-03-22 00:34:23 -0700 |
---|---|---|
committer | Steve Peters <steve@fisharerojo.org> | 2007-03-22 14:43:32 +0000 |
commit | 27aad8a31de0f67b4d9a413b706e8d551b21977c (patch) | |
tree | 8f33d2ee34085e696a84a5ef10f9631d397bb2d8 /ext | |
parent | 711108514e45d680212360b83caeba9f5b14dbe2 (diff) | |
download | perl-27aad8a31de0f67b4d9a413b706e8d551b21977c.tar.gz |
Fix to threads::shared t/waithires.t
From: "Jerry D. Hedden" <jdhedden@yahoo.com>
Message-ID: <381102.32342.qm@web30207.mail.mud.yahoo.com>
p4raw-id: //depot/perl@30687
Diffstat (limited to 'ext')
-rw-r--r-- | ext/threads/shared/t/waithires.t | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/ext/threads/shared/t/waithires.t b/ext/threads/shared/t/waithires.t index a89323d229..8620ab56a5 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"); } } } |