From: Eric Wong Date: Tue, 21 May 2024 07:14:23 +0000 (+0000) Subject: t/lei-tag: allow changing time for --commit-delay test X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=395bf373b7c77f2bd958a41eb6503a2ee5e4c8c5;p=thirdparty%2Fpublic-inbox.git t/lei-tag: allow changing time for --commit-delay test 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. --- diff --git a/t/lei-tag.t b/t/lei-tag.t index 7278dfcdc..48295a577 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;