From 300309cebbf802463f2d7d235f2cf33d28f0760a Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 21 Mar 2021 15:50:47 +0600 Subject: lei: fix some warnings in tests And then test the contents of $lei_err to ensure it doesn't happen again. We'll also make MboxLock emit nicer warnings without the line number, since the line number is irrelevant to the user fixing an mbox lock contention problem. Finally, we'll also allow showing loud warnings via TEST_LEI_ERR_LOUD=1 --- lib/PublicInbox/TestCommon.pm | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/PublicInbox/TestCommon.pm') diff --git a/lib/PublicInbox/TestCommon.pm b/lib/PublicInbox/TestCommon.pm index 0d15514e..e67e94ea 100644 --- a/lib/PublicInbox/TestCommon.pm +++ b/lib/PublicInbox/TestCommon.pm @@ -457,6 +457,15 @@ sub lei (@) { my $res = run_script(['lei', @$cmd], $env, $xopt // $lei_opt); $err_skip and $lei_err = join('', grep(!/$err_skip/, split(/^/m, $lei_err))); + if ($lei_err ne '') { + if ($lei_err =~ /Use of uninitialized/ || + $lei_err =~ m!\bArgument .*? isn't numeric in !) { + fail "lei_err=$lei_err"; + } else { + state $loud = $ENV{TEST_LEI_ERR_LOUD}; + diag "lei_err=$lei_err" if $loud; + } + } $res; }; -- cgit v1.2.3-24-ge0c7