X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fv2reindex.t;h=cafe8648d1e8b0dd1275f6af884585402e5aee70;hb=21fd0da3bcfba4d3564d262f88d3fd7479b6d5ee;hp=05ea952f43e1002f08028d5bb277208f816bb8d3;hpb=af0b0fb7a454470a32c452119d0392e0dedb3fe1;p=public-inbox.git
diff --git a/t/v2reindex.t b/t/v2reindex.t
index 05ea952f..cafe8648 100644
--- a/t/v2reindex.t
+++ b/t/v2reindex.t
@@ -1,12 +1,9 @@
# Copyright (C) 2018-2021 all contributors
# License: AGPL-3.0+
-use strict;
-use warnings;
-use Test::More;
+use strict; use v5.10.1; use PublicInbox::TestCommon;
use PublicInbox::Eml;
use PublicInbox::ContentHash qw(content_digest);
use File::Path qw(remove_tree);
-use PublicInbox::TestCommon;
require_git(2.6);
require_mods(qw(DBD::SQLite Search::Xapian));
use_ok 'PublicInbox::V2Writable';
@@ -18,6 +15,7 @@ my $ibx_config = {
version => 2,
-primary_address => 'test@example.com',
indexlevel => 'full',
+ -no_fsync => 1,
};
my $agpl = do {
open my $fh, '<', 'COPYING' or die "can't open COPYING: $!";
@@ -543,4 +541,17 @@ EOF
$check_rethread->('3-headed-monster once');
$check_rethread->('3-headed-monster twice');
+my $rdr = { 2 => \(my $err = '') };
+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: {
+ skip 'only testing lsof(8) output on Linux', 1 if $^O ne 'linux';
+ my $lsof = require_cmd('lsof', 1) 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();