Skip to content

Commit

Permalink
Fix "make test" with SIGTERM ignored.
Browse files Browse the repository at this point in the history
If the process that exec'd "make test" had SIGTERM set to SIG_IGN, one
test failed.  That not a clearly-valid use case.  Even so, since all but
one test already survived that scenario, make the last test cope.
https://www.cpantesters.org/report/efbcc1aa-f5f1-11ee-a642-ee3ed50263fb
inspired this.  That smoke tester starting failing when it upgraded from
NetBSD 9.3 to NetBSD 10.0.  I don't know the cause of the failures; this
may or may not fix them.
  • Loading branch information
nmisch committed May 19, 2024
1 parent 85ed0b9 commit cc77688
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions t/kill_kill.t
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,19 @@ else {

# Test 1
SCOPE: {
my $out;
my $h = IPC::Run::start(
[
$^X,
'-e',
'sleep while 1',
]
'$SIG{TERM}="DEFAULT";$|=1;print "running\n";sleep while 1',
],
\undef,
\$out
);

pump $h until $out =~ /running/;
my $needed = $h->kill_kill;
ok( !$needed, 'Did not need kill_kill' );
ok( !$needed, 'kill_kill SIGTERM suffices for ordinary command' );
}

# Test 2
Expand All @@ -64,5 +67,5 @@ SKIP: {
);
pump $h until $out =~ /running/;
my $needed = $h->kill_kill( grace => 1 );
ok( $needed, 'Did need kill_kill' );
ok( $needed, 'kill_kill of SIGINT-ignoring command needs SIGKILL' );
}

0 comments on commit cc77688

Please sign in to comment.