test(search): in-brain Query race queries the inside note too
CI / Lint / Test / Vet (pull_request) Successful in 1m11s
CI / Mirror to GitHub (pull_request) Skipped

After main's #177 floor (AssertNoLeakFrom needs at least one read that
returns the inside note), this test went red on merge: the reader
queried only the sentinel, so the regular note could never be a hit
and the race had been passing vacuously. Query both terms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-05 16:20:41 +02:00
co-authored by Claude Opus 5.5
parent 51183d64d8
commit 1cf05fdf15
+3 -1
View File
@@ -205,7 +205,9 @@ func TestQueryDoesNotReturnAnInBrainSymlinkTargetDuringASampledSwapRace(t *testi
brain, facts, _ := searchBrain(t)
target := inBrainTarget(t, brain)
read := func() string {
rs, _ := Query(brain, QueryOptions{Query: brainfstest.Sentinel, Limit: 10})
// Both terms, so the regular note is a possible hit: a reader that
// never returns the inside note would pass vacuously (#177 floor).
rs, _ := Query(brain, QueryOptions{Query: brainfstest.Sentinel + " zqinside", Limit: 10})
s := ""
for _, r := range rs {
s += r.Title + r.Excerpt