]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/v2reindex.t
lei q|lcat: support "-f reply" output format
[public-inbox.git] / t / v2reindex.t
index 56540c8b1847bbd4ea7aad3d6c0f04cb14569781..e9f2b73b2b9083060359a45300c2fc286f173853 100644 (file)
@@ -18,6 +18,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: $!";
@@ -544,8 +545,17 @@ $check_rethread->('3-headed-monster once');
 $check_rethread->('3-headed-monster twice');
 
 my $rdr = { 2 => \(my $err = '') };
-ok(run_script([qw(-index --reindex --xapian-only), $inboxdir], undef, $rdr),
+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();