]> Sergey Matveev's repositories - public-inbox.git/commitdiff
tests: show lsof output on deleted-file-check failures
authorEric Wong <e@80x24.org>
Wed, 17 Mar 2021 07:02:18 +0000 (23:02 -0800)
committerEric Wong <e@80x24.org>
Wed, 17 Mar 2021 19:03:14 +0000 (19:03 +0000)
This may help track down some occasional test failures I'm
seeing.

t/httpd-corner.t
t/nntpd.t

index 794d8aebe7ca0414a22492bb747778784e839723..296e1dc1abfa1b7416838a40f3a813c5ad270353 100644 (file)
@@ -610,7 +610,8 @@ SKIP: {
        my $null_in = '';
        my $rdr = { 2 => \(my $null_err), 0 => \$null_in };
        my @lsof = xqx([$lsof, '-p', $td->{pid}], undef, $rdr);
-       is_deeply([grep(/\bdeleted\b/, @lsof)], [], 'no lingering deleted inputs');
+       my $d = [ grep(/\(deleted\)/, @lsof) ];
+       is_deeply($d, [], 'no lingering deleted inputs') or diag explain($d);
 
        # filter out pipes inherited from the parent
        my @this = xqx([$lsof, '-p', $$], undef, $rdr);
index 7db371ddb661306034b91b9ece026f466607f9cc..ce4d7cf9bf00a93415326ae07f7000001574b14b 100644 (file)
--- a/t/nntpd.t
+++ b/t/nntpd.t
@@ -365,8 +365,9 @@ Date: Fri, 02 Oct 1993 00:00:00 +0000
                $lsof or skip 'lsof missing', 1;
                ($^O =~ /\A(?:linux)\z/) or
                        skip "lsof /(deleted)/ check untested on $^O", 1;
-               my @of = xqx([$lsof, '-p', $td->{pid}], undef, $noerr);
-               is(scalar(grep(/\(deleted\)/, @of)), 0, 'no deleted files');
+               my @lsof = xqx([$lsof, '-p', $td->{pid}], undef, $noerr);
+               my $d = [ grep(/\(deleted\)/, @lsof) ];
+               is_deeply($d, [], 'no deleted files') or diag explain($d);
        };
        SKIP: { test_watch($tmpdir, $host_port, $group) };
        {