Skip to content

Commit

Permalink
[test] Re-enabled instable signals tests as TODO
Browse files Browse the repository at this point in the history
signals do work fine manually, just the tests not.
eg. on darwin:
$ (./parrot t/pmc/signal_1.pasm &); ps | grep "./[p]arrot" | cut -c1-6 | xargs kill -HUP
start
$ (./parrot t/pmc/signal_3.pasm &); ps | grep "./[p]arrot" | cut -c1-6 | xargs kill -HUP
start
  • Loading branch information
Reini Urban committed Nov 23, 2014
1 parent e0759c1 commit d8c1e99
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
2 changes: 2 additions & 0 deletions ChangeLog
Expand Up @@ -20,6 +20,8 @@
+ Fix t/steps/auto/arch-01.t darwin regression #1142
+ Added bigger t/stress/gc.t test to catch most GC issues.
+ Add optional copyright year test on TEST_SLOW #719
+ Re-enabled instable signals tests as TODO. signals do work fine,
just the tests not.
- Community

2014-11-18 release 6.10.0
Expand Down
26 changes: 13 additions & 13 deletions t/pmc/signal.t
Expand Up @@ -17,13 +17,13 @@ t/pmc/signal.t - Signal Handling
=head1 DESCRIPTION
Tests signal handling.
Tests signal handling. These tests are very instable, but do work manually.
=cut

# actually more platforms should work - all POSIX compliant ones
# a second problem is to get the test doing the right thing: mainly figuring
# out what PID to kill. The "ps" command isn't one of the portable ones.
# out what PID to kill. The "kill" and "ps" commands aren't one of the portable ones.


my %platforms = map { $_ => 1 } qw/
Expand All @@ -34,12 +34,12 @@ my %platforms = map { $_ => 1 } qw/
/;

if ( $platforms{$^O} ) {
plan tests => 4;
plan tests => 6;
$ENV{DYLD_LIBRARY_PATH} = "" if $^O eq 'darwin';
#plan skip_all => 'Signals currently disabled';
#plan skip_all => 'Instable signal tests currently disabled';
}
else {
plan skip_all => 'Missing portable getpid hack';
plan skip_all => 'Missing portable getpid and kill';
}

#
Expand All @@ -49,7 +49,8 @@ else {
my $pid;

sub parrot_pids {
grep { !/harness/ && !/ Z / && !/sh -c/ } `ps axw | grep '[p]arrot'`;
grep { !/harness/ && !/ Z / && !/sh -c/ && !/ \(/}
`ps | grep '[p]arrot'`;
}
sub send_SIGHUP {
Expand All @@ -65,7 +66,6 @@ sub send_SIGHUP {
my $io_thread = pop @ps;
if ( $io_thread =~ /^\s*(\d+)/ ) {
$pid = $1;

# send a
kill 'SIGHUP', $pid;
}
Expand All @@ -90,7 +90,7 @@ sub check_running {

send_SIGHUP;

pasm_output_is( <<'CODE', <<'OUTPUT', "SIGHUP event - sleep" );
pasm_output_is( <<'CODE', <<'OUTPUT', "SIGHUP event - sleep", todo => 'instable signal tests');
print "start\n"
# no exception handler - parrot should die silently
sleep 2
Expand All @@ -104,7 +104,7 @@ check_running;

send_SIGHUP;

pasm_output_is( <<'CODE', <<'OUTPUT', "SIGHUP event - loop" );
pasm_output_is( <<'CODE', <<'OUTPUT', "SIGHUP event - loop", todo => 'instable signal tests');
# bounds 1 # no JIT
print "start\n"
# no exception handler - parrot should die silently
Expand All @@ -118,13 +118,13 @@ CODE
start
OUTPUT

# check_running;
check_running;

SKIP: {
skip( "works standalone but not in test", 1 );
skip( "works standalone but not in test", 1 ) if 0;
send_SIGHUP;

pasm_output_is( <<'CODE', <<'OUTPUT', "SIGHUP event - sleep, catch" );
pasm_output_is( <<'CODE', <<'OUTPUT', "SIGHUP event - sleep, catch", todo => 'instable signal tests' );
push_eh _handler
print "start\n"
sleep 2
Expand All @@ -150,7 +150,7 @@ start
catched SIGHUP
OUTPUT

# check_running;
check_running;
}

# Local Variables:
Expand Down

0 comments on commit d8c1e99

Please sign in to comment.