+ # -compact requires Xapian
+ SKIP: {
+ require_mods('Search::Xapian', 2);
+ which('xapian-compact') or skip 'xapian-compact missing', 2;
+ is(xsys(qw(git config), "--file=$home/.public-inbox/config",
+ "publicinbox.$group.indexlevel", 'medium'),
+ 0, 'upgraded indexlevel');
+ my $ex = eml_load('t/data/0001.patch');
+ is($n->article($ex->header('Message-ID')), undef,
+ 'article did not exist');
+ $im->add($ex);
+ $im->done;
+ ok(run_script([qw(-index --reindex -c), $ibx->{inboxdir}],
+ undef, $noerr), '-compacted');
+ select(undef, undef, undef, $fast_idle ? 0.1 : 2.1);
+ $art = $n->article($ex->header('Message-ID'));
+ ok($art, 'new article retrieved after compact');
+ $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');
+ };