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/v2writable: avoid failure on strace un-readyiness
Date: Fri, 30 Aug 2024 19:05:29 +0000	[thread overview]
Message-ID: <20240830190529.2169094-1-e@80x24.org> (raw)

poll(2) uses milliseconds, IO::Poll::_poll doesn't abstract that,
nor does our ->poll_in wrapper.  This ensures we wait enough time
for strace to start up on overloaded systems.
---
 t/v2writable.t | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/v2writable.t b/t/v2writable.t
index 496eba2c..4c24ee92 100644
--- a/t/v2writable.t
+++ b/t/v2writable.t
@@ -343,7 +343,7 @@ SKIP: {
 	open my $fh, '>', my $trace = "$inboxdir/trace.out";
 	my $rd = popen_rd([ $strace, '-p', $$, '-o', $trace,
 		'-e', 'inject=pwrite64:error=ENOSPC'], undef, { 2 => 1 });
-	$rd->poll_in(10) or die 'strace not ready';
+	$rd->poll_in(10_000) or die 'strace not ready';
 	ok ! eval {
 		open my $olderr, '>&', \*STDERR;
 		open STDERR, '>>', $gfi_err;
@@ -362,7 +362,7 @@ SKIP: {
 	$rd = popen_rd([$strace, '-p', $pid, '-o', $trace,
 		'-e', 'inject=write:error=ENOSPC:when=1'],
 		undef, { 2 => 1 });
-	$rd->poll_in(10) or die 'strace not ready';
+	$rd->poll_in(10_000) or die 'strace not ready';
 	ok !eval { $im->done }, 'done fails with ENOSPC';
 	ok $@, '$@ set on ENOSPC';
 	kill 'TERM', $rd->attached_pid;

                 reply	other threads:[~2024-08-30 19:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20240830190529.2169094-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).