* [PATCH 7/9] v2writable: cleanup SQLite handles on --xapian-only
@ 2021-03-24 9:23 4% ` Eric Wong
0 siblings, 0 replies; 3+ results
From: Eric Wong @ 2021-03-24 9:23 UTC (permalink / raw)
To: meta
I'm not sure exactly why this is needed with run_script
localizing %SIG and everything else, but explictly cleaning up
seems to fix the occasional test failures I see.
Followup-to: 4c6c853494b49368 ("tests: show lsof output on deleted-file-check failures")
---
lib/PublicInbox/V2Writable.pm | 1 +
t/v2reindex.t | 10 +++++++++-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm
index 03590850..4130a472 100644
--- a/lib/PublicInbox/V2Writable.pm
+++ b/lib/PublicInbox/V2Writable.pm
@@ -1323,6 +1323,7 @@ sub xapian_only {
}
}
$self->git->cat_async_wait;
+ $self->{ibx}->cleanup;
$self->done;
}
diff --git a/t/v2reindex.t b/t/v2reindex.t
index 1145e31b..e9f2b73b 100644
--- a/t/v2reindex.t
+++ b/t/v2reindex.t
@@ -549,5 +549,13 @@ my $env = { PI_CONFIG => '/dev/null' };
ok(run_script([qw(-index --reindex --xapian-only), $inboxdir], $env, $rdr),
'--xapian-only works');
is($err, '', 'no errors from --xapian-only');
-
+undef $for_destroy;
+SKIP: {
+ use PublicInbox::Spawn qw(which);
+ skip 'only testing lsof(8) output on Linux', 1 if $^O ne 'linux';
+ my $lsof = which('lsof') or skip 'no lsof in PATH', 1;
+ my $rdr = { 2 => \(my $null_err) };
+ my @d = grep(m!/xap[0-9]+/!, xqx([$lsof, '-p', $$], undef, $rdr));
+ is_deeply(\@d, [], 'no deleted index files') or diag explain(\@d);
+}
done_testing();
^ permalink raw reply related [relevance 4%]
* [PATCH 5/5] tests: show lsof output on deleted-file-check failures
2021-03-17 7:02 4% [PATCH 0/5] www: extindex stuff Eric Wong
@ 2021-03-17 7:02 7% ` Eric Wong
0 siblings, 0 replies; 3+ results
From: Eric Wong @ 2021-03-17 7:02 UTC (permalink / raw)
To: meta
This may help track down some occasional test failures I'm
seeing.
---
t/httpd-corner.t | 3 ++-
t/nntpd.t | 5 +++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/t/httpd-corner.t b/t/httpd-corner.t
index 794d8aeb..296e1dc1 100644
--- a/t/httpd-corner.t
+++ b/t/httpd-corner.t
@@ -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);
diff --git a/t/nntpd.t b/t/nntpd.t
index 7db371dd..ce4d7cf9 100644
--- 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) };
{
^ permalink raw reply related [relevance 7%]
* [PATCH 0/5] www: extindex stuff
@ 2021-03-17 7:02 4% Eric Wong
2021-03-17 7:02 7% ` [PATCH 5/5] tests: show lsof output on deleted-file-check failures Eric Wong
0 siblings, 1 reply; 3+ results
From: Eric Wong @ 2021-03-17 7:02 UTC (permalink / raw)
To: meta
extindex.{url,coderepo,infourl} knobs should all be working,
altid may work, but might not be useful. coderepo visibility
is also improved.
Eric Wong (5):
www_stream: add trailing slash for help and color links
extindex: add some validation and config knobs for WWW
config: lazy-load coderepos, support extindex
www: improve visibility of coderepos
tests: show lsof output on deleted-file-check failures
MANIFEST | 1 +
lib/PublicInbox/Config.pm | 122 +++++++++++++++++++------------
lib/PublicInbox/ExtSearch.pm | 2 +-
lib/PublicInbox/Git.pm | 2 +-
lib/PublicInbox/TestCommon.pm | 28 ++++++-
lib/PublicInbox/View.pm | 5 +-
lib/PublicInbox/WWW.pm | 2 +-
lib/PublicInbox/WwwAtomStream.pm | 6 +-
lib/PublicInbox/WwwStream.pm | 27 ++++---
lib/PublicInbox/WwwText.pm | 2 +-
t/config.t | 6 +-
t/extindex-psgi.t | 48 ++++++++++++
t/httpd-corner.t | 3 +-
t/nntpd.t | 5 +-
t/psgi_v2.t | 30 ++------
15 files changed, 191 insertions(+), 98 deletions(-)
create mode 100644 t/extindex-psgi.t
^ permalink raw reply [relevance 4%]
Results 1-3 of 3 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2021-03-17 7:02 4% [PATCH 0/5] www: extindex stuff Eric Wong
2021-03-17 7:02 7% ` [PATCH 5/5] tests: show lsof output on deleted-file-check failures Eric Wong
2021-03-24 9:23 [PATCH 0/9] lei: various corner case leak fixes Eric Wong
2021-03-24 9:23 4% ` [PATCH 7/9] v2writable: cleanup SQLite handles on --xapian-only Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
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).