test: let the search-parity corpus past the anti-spam filter

The fixture re-recorded in #4299 holds the same long-form article posted
by two authors. LocalCache's anti-spam filter keeps the second copy out,
so anAddressableKindComesBackThroughTheAddressablePath could never find
it and main went red. The class tests the filter path, not spam policy:
switch the filter off while loading the corpus and restore it after,
since LocalCache is shared with the other test classes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017KKAj1seHQLCcVEiMeePEE
This commit is contained in:
Claude
2026-10-01 16:41:33 +00:00
parent 9931018904
commit ae55ae262f
@@ -82,7 +82,18 @@ class LocalCacheSearchParityTest {
// LocalCache.consume refuses the main thread; a plain JVM test has no Looper, so the
// check passes and the events land synchronously.
corpus.forEach { LocalCache.justConsumeMyOwnEvent(it) }
//
// The corpus is live relay data and carries the same long-form article posted by two
// authors, which the anti-spam filter keeps out of the cache as a copy. This class tests
// the filter path, not spam policy, so the whole corpus goes in; the flag is restored
// because LocalCache is shared with every other test class in the JVM.
val antiSpamWasActive = LocalCache.antiSpam.active
LocalCache.antiSpam.active = false
try {
corpus.forEach { LocalCache.justConsumeMyOwnEvent(it) }
} finally {
LocalCache.antiSpam.active = antiSpamWasActive
}
}
}