From 2a41e811ad89a026cf7824228a053bd623fd7b7f Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 28 Mar 2023 10:53:58 +0000 Subject: [PATCH] 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. --- t/lei-refresh-mail-sync.t | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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}; -- 2.47.3