about summary refs log tree commit homepage
path: root/t/xcpdb-reshard.t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2020-01-04 21:37:52 +0000
committerEric Wong <e@80x24.org>2020-01-04 22:08:08 +0000
commitcb850caf867e3e6920233c1c1ab7120cac054af8 (patch)
tree3fae0ca287eb514312cecd441ebda7b3ec6e7426 /t/xcpdb-reshard.t
parent9c6dbb636ae2738c4b5d5b96752b7433be0d7b62 (diff)
downloadpublic-inbox-cb850caf867e3e6920233c1c1ab7120cac054af8.tar.gz
PublicInbox::Search always loads DBD::SQLite, so we
can't blindly "use" it in t/xcpdb-reshard.t.  We also
need to account for that in TestCommon.
Diffstat (limited to 't/xcpdb-reshard.t')
-rw-r--r--t/xcpdb-reshard.t7
1 files changed, 5 insertions, 2 deletions
diff --git a/t/xcpdb-reshard.t b/t/xcpdb-reshard.t
index 2a0aeb45..9f0034f1 100644
--- a/t/xcpdb-reshard.t
+++ b/t/xcpdb-reshard.t
@@ -8,7 +8,7 @@ require_mods(qw(DBD::SQLite Search::Xapian));
 require_git('2.6');
 use PublicInbox::MIME;
 use PublicInbox::InboxWritable;
-use PublicInbox::Search;
+require PublicInbox::Search;
 
 my $mime = PublicInbox::MIME->create(
         header => [
@@ -62,7 +62,10 @@ for my $R (qw(2 4 1 3 3)) {
         # ensure docids in Xapian match NNTP article numbers
         my $tot = 0;
         my %tmp = %nums;
-        my $XapianDatabase = $PublicInbox::Search::X{Database};
+        my $XapianDatabase = do {
+                no warnings 'once';
+                $PublicInbox::Search::X{Database};
+        };
         foreach my $d (@new_shards) {
                 my $xdb = $XapianDatabase->new($d);
                 $tot += $xdb->get_doccount;