From: Eric Wong Date: Tue, 28 Mar 2023 10:53:58 +0000 (+0000) Subject: t/lei-refresh-mail-sync: improve test reliability X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2a41e811ad89a026cf7824228a053bd623fd7b7f;p=thirdparty%2Fpublic-inbox.git t/lei-refresh-mail-sync: improve test reliability Lack of signalfd/EVFILT_SIGNAL means we need to kill a process repeatedly to ensure it wakes up. --- diff --git a/t/lei-refresh-mail-sync.t b/t/lei-refresh-mail-sync.t index 0498a0c42..8ccc68c62 100644 --- a/t/lei-refresh-mail-sync.t +++ b/t/lei-refresh-mail-sync.t @@ -137,8 +137,12 @@ SKIP: { my $ar = PublicInbox::AutoReap->new($pid); ok(!(lei 'refresh-mail-sync', $url), 'URL fails on dead -imapd'); ok(!(lei 'refresh-mail-sync', '--all'), '--all fails on dead -imapd'); - $ar->kill for qw(avoid sig wake miss-no signalfd or EVFILT_SIG); - $ar->join('TERM'); + { + local $SIG{CHLD} = sub { $ar->join('TERM'); undef $ar }; + do { + eval { $ar->kill and tick(0.01) } + } while (defined($ar)); + } my $cmd = $srv->{imapd}->{cmd}; my $s = $srv->{imapd}->{s};