From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 117531F452 for ; Tue, 28 Mar 2023 10:53:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1680000838; bh=i+pJpHUHJieRJ5g8ncQB5uSXHSDxaWkt8CwEMZ8DS1c=; h=From:To:Subject:Date:From; b=gcFQucFfFFFMKIpPyA+Kfh9OQL9ZMM+w36awqf7lWPL77rKSiE1Jpl0MD6Mo9Xapp +a1SDnY7/nSGdxkmLby+R69ST09wN+Jy5W5UikBaeFqB8Q0GWOQuYZaUKfYD2XLowW oHRbKZWfh1Q3RTSkvuAJyTIhW1WapyniHAvS0PoA= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] t/lei-refresh-mail-sync: improve test reliability Date: Tue, 28 Mar 2023 10:53:58 +0000 Message-Id: <20230328105358.3553062-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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 0498a0c4..8ccc68c6 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};