]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
t/lei-tag: allow changing time for --commit-delay test
authorEric Wong <e@80x24.org>
Tue, 21 May 2024 07:14:23 +0000 (07:14 +0000)
committerEric Wong <e@80x24.org>
Tue, 21 May 2024 19:55:00 +0000 (19:55 +0000)
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

index 7278dfcdc22b4fc3e46ce7f65abac65be828d918..48295a57744544300b38dd2860e48234ba8b8a6d 100644 (file)
@@ -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;