unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH] t/lei-refresh-mail-sync: improve test reliability
Date: Tue, 28 Mar 2023 10:53:58 +0000	[thread overview]
Message-ID: <20230328105358.3553062-1-e@80x24.org> (raw)

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};

             reply	other threads:[~2023-03-28 10:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-28 10:53 Eric Wong [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-09-18 22:38 [PATCH] t/lei-refresh-mail-sync: improve test reliability Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230328105358.3553062-1-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).