From ce22df0ef5ad8cdb498f164b191a00c275fd5a89 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Thu, 20 Apr 2006 19:58:11 +0000 Subject: [PATCH] Integrate: [ 23474] Skip failing thread/wait tests on HP-UX 10.20 These will never ever be fixed, since 10.20 is obsolete perl583delta describes this. The quote is included in wait.t p4raw-link: @23474 on //depot/perl: 80b2a6875ff4c6d50022d6618abf6aa340ea38d3 p4raw-id: //depot/maint-5.8/perl@27920 p4raw-integrated: from //depot/perl@27916 'copy in' ext/threads/shared/t/wait.t (@22133..) --- ext/threads/shared/t/wait.t | 60 +++++++++++++++++++++++++++++++-------------- 1 file changed, 42 insertions(+), 18 deletions(-) diff --git a/ext/threads/shared/t/wait.t b/ext/threads/shared/t/wait.t index d1b7c0a..451af2a 100644 --- a/ext/threads/shared/t/wait.t +++ b/ext/threads/shared/t/wait.t @@ -29,6 +29,16 @@ sub ok { print "${not}ok " . ($Base + $offset) . " - $text\n"; } +# The two skips later on in these tests refer to this quote from the +# pod/perl583delta.pod: +# +# =head1 Platform Specific Problems +# +# The regression test ext/threads/shared/t/wait.t fails on early RedHat 9 +# and HP-UX 10.20 due to bugs in their threading implementations. +# RedHat users should see https://rhn.redhat.com/errata/RHBA-2003-136.html +# and consider upgrading their glibc. + sub forko (&$$); # To prevent deadlock from underlying pthread_* bugs (as in # stock RH9 glibc/NPTL) or from our own errors, we run tests # in separately forked and alarmed processes. @@ -195,16 +205,23 @@ SYNC_SHARED: { sub ctw_fail { my $to = shift; - $test =~ /twain/ ? lock($lock) : lock($cond); - ok(1,1, "$test: obtained initial lock"); - my $ok; - for ($test) { - $ok=cond_timedwait($cond, time() + $to), last if /simple/; - $ok=cond_timedwait($cond, time() + $to, $cond), last if /repeat/; - $ok=cond_timedwait($cond, time() + $to, $lock), last if /twain/; - die "$test: unknown test\n"; + if ($^O eq "hpux" && $Config{osvers} <= 10.20) { + # The lock obtaining would pass, but the wait will not. + ok(1,1, "$test: obtained initial lock"); + ok(2,0, "# SKIP see perl583delta"); + } + else { + $test =~ /twain/ ? lock($lock) : lock($cond); + ok(1,1, "$test: obtained initial lock"); + my $ok; + for ($test) { + $ok=cond_timedwait($cond, time() + $to), last if /simple/; + $ok=cond_timedwait($cond, time() + $to, $cond), last if /repeat/; + $ok=cond_timedwait($cond, time() + $to, $lock), last if /twain/; + die "$test: unknown test\n"; + } + ok(2,!defined($ok), "$test: timeout"); } - ok(2,!defined($ok), "$test: timeout"); } } # -- SYNCH_SHARED block @@ -322,16 +339,23 @@ SYNCH_REFS: { sub ctw_fail2 { my $to = shift; - $test =~ /twain/ ? lock($lock) : lock($cond); - ok(1,1, "$test: obtained initial lock"); - my $ok; - for ($test) { - $ok=cond_timedwait($cond, time() + $to), last if /simple/; - $ok=cond_timedwait($cond, time() + $to, $cond), last if /repeat/; - $ok=cond_timedwait($cond, time() + $to, $lock), last if /twain/; - die "$test: unknown test\n"; + if ($^O eq "hpux" && $Config{osvers} <= 10.20) { + # The lock obtaining would pass, but the wait will not. + ok(1,1, "$test: obtained initial lock"); + ok(2,0, "# SKIP see perl583delta"); + } + else { + $test =~ /twain/ ? lock($lock) : lock($cond); + ok(1,1, "$test: obtained initial lock"); + my $ok; + for ($test) { + $ok=cond_timedwait($cond, time() + $to), last if /simple/; + $ok=cond_timedwait($cond, time() + $to, $cond), last if /repeat/; + $ok=cond_timedwait($cond, time() + $to, $lock), last if /twain/; + die "$test: unknown test\n"; + } + ok(2,!$ok, "$test: timeout"); } - ok(2,!$ok, "$test: timeout"); } } # -- SYNCH_REFS block -- 1.8.3.1