dumping ground for random patches and texts
 help / color / mirror / Atom feed
* [PATCH] t/lei-tag: allow changing time for --commit-delay test
@ 2024-05-20 18:44 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2024-05-20 18:44 UTC (permalink / raw)
  To: spew

Sometimes `lei ls-label' can run slowly enough that the
previously-scheduled delayed commit happens by the time it runs.
So support tuning the delay and add a helpful message to someone
analyzing failures on slow/overloaded machines.
---
 t/lei-tag.t | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/t/lei-tag.t b/t/lei-tag.t
index 7278dfcd..48295a57 100644
--- a/t/lei-tag.t
+++ b/t/lei-tag.t
@@ -106,12 +106,14 @@ test_lei(sub {
 	like $lei_err, qr/\b1 unimported messages/, 'noted unimported'
 		or diag $lei_err;
 
-	lei_ok qw(tag -F eml --commit-delay=1 t/utf8.eml +L:utf8);
+	my $delay = $ENV{TEST_LEI_COMMIT_DELAY} // 1;
+	lei_ok qw(tag -F eml t/utf8.eml +L:utf8), "--commit-delay=$delay";
 	lei_ok 'ls-label';
-	unlike($lei_out, qr/\butf8\b/, 'commit-delay delays label');
+	unlike $lei_out, qr/\butf8\b/, 'commit-delay delays label' or
+		warn "E: consider increasing TEST_LEI_COMMIT_DELAY=$delay";
 	my $end = now + 10;
 	my $n = 1;
-	diag 'waiting for lei/store commit...';
+	diag "waiting for lei/store commit... (--commit-delay=$delay)";
 	do {
 		tick $n;
 		$n = 0.1;

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-05-20 18:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-20 18:44 [PATCH] t/lei-tag: allow changing time for --commit-delay test Eric Wong

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