about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-10-11 08:06:20 +0000
committerEric Wong <e@80x24.org>2021-10-12 03:40:44 +0000
commited0167d2a851b4f5128f57ad60309a0b76e62cfa (patch)
tree7d5562ff023f007d679615bf393da0c631ba6b7a /t
parentab257671a4112044582a333cdb50cc9067adab14 (diff)
downloadpublic-inbox-ed0167d2a851b4f5128f57ad60309a0b76e62cfa.tar.gz
When unref-ing a blob from xref3, make sure the "preferred"
smsg->{blob} doesn't point to the blob we just unrefed.  This
is necessary because we periodically checkpoint our extindex
process to allow -watch and -mda processes to run.

This also gets rid of a lot of redundant code for ->remove_xref3,
since it's all handled in ExtSearchIdx, now.
Diffstat (limited to 't')
-rw-r--r--t/extsearch.t2
-rw-r--r--t/over.t5
2 files changed, 4 insertions, 3 deletions
diff --git a/t/extsearch.t b/t/extsearch.t
index 896e2704..1b6235ba 100644
--- a/t/extsearch.t
+++ b/t/extsearch.t
@@ -375,7 +375,7 @@ if ('reindex catches content bifurcation') {
         is($oidx->max, $oldmax, 'oidx->max unchanged');
         $oidx->dbh_close;
         ok(run_script([qw(-extindex --reindex --all), "$home/extindex"],
-                undef, $opt), 'extindex --reindex');
+                undef, $opt), 'extindex --reindex') or diag explain($opt);
         $oidx->dbh;
         ok($oidx->max > $oldmax, 'oidx->max bumped');
         like($err, qr/split into 2 due to deduplication change/,
diff --git a/t/over.t b/t/over.t
index a92d2f77..1f2df7cf 100644
--- a/t/over.t
+++ b/t/over.t
@@ -90,8 +90,9 @@ $over->eidx_prep;
                         'example.kee:2018:deadbeefcafe' ],
                         'xref3 works forw two');
 
-        @arg = qw(1349 adeadba7cafe example.key);
-        is($over->remove_xref3(@arg), 1, 'remove first');
+        is($over->dbh->do(<<''), 1, 'remove first');
+DELETE FROM xref3 WHERE xnum = 2019 AND docid = 1349
+
         $xref3 = $over->get_xref3(1349);
         is_deeply($xref3, [ 'example.kee:2018:deadbeefcafe' ],
                 'confirm removal successful');