This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
op/sigdispatch.t: skip tests on prodn releases
authorDavid Mitchell <davem@iabyn.com>
Sat, 14 Apr 2012 09:28:35 +0000 (10:28 +0100)
committerDavid Mitchell <davem@iabyn.com>
Sat, 14 Apr 2012 09:28:35 +0000 (10:28 +0100)
RT #89718 showed a couple of tests hanging on old linux kernels.
Until such time as someone can reliably probe for this, just
completely skip those tests on production releases.

t/op/sigdispatch.t

index 332507f..8161a71 100644 (file)
@@ -89,16 +89,24 @@ TODO:
     is $gotit, 2, 'Received fifth signal';
 
     # test unsafe signal handlers in combination with exceptions
-    my $action = POSIX::SigAction->new(sub { $gotit--, die }, POSIX::SigSet->new, 0);
-    POSIX::sigaction(&POSIX::SIGALRM, $action);
-    eval {
-        alarm 1;
-        my $set = POSIX::SigSet->new;
-        POSIX::sigprocmask(&POSIX::SIG_BLOCK, undef, $set);
-        is $set->ismember(&POSIX::SIGALRM), 0, "SIGALRM is not blocked on attempt $_";
-        POSIX::sigsuspend($set);
-    } for 1..2;
-    is $gotit, 0, 'Received both signals';
+
+    SKIP: {
+       # #89718: on old linux kernels, this test hangs. No-ones thought
+       # of a reliable way to probe for this, so for now, just skip the
+       # tests on production releases
+       skip("some OSes hang here", 3) if (int($]*1000) & 1) == 0;
+
+       my $action = POSIX::SigAction->new(sub { $gotit--, die }, POSIX::SigSet->new, 0);
+       POSIX::sigaction(&POSIX::SIGALRM, $action);
+       eval {
+           alarm 1;
+           my $set = POSIX::SigSet->new;
+           POSIX::sigprocmask(&POSIX::SIG_BLOCK, undef, $set);
+           is $set->ismember(&POSIX::SIGALRM), 0, "SIGALRM is not blocked on attempt $_";
+           POSIX::sigsuspend($set);
+       } for 1..2;
+       is $gotit, 0, 'Received both signals';
+    }
 }
 
 SKIP: {