From ae55ae262f1e4b41c787da6d9786ae5ff0f5a70e Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 1 Oct 2026 16:41:33 +0000 Subject: [PATCH] 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 Claude-Session: https://claude.ai/code/session_017KKAj1seHQLCcVEiMeePEE --- .../amethyst/model/LocalCacheSearchParityTest.kt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/amethyst/src/test/java/com/vitorpamplona/amethyst/model/LocalCacheSearchParityTest.kt b/amethyst/src/test/java/com/vitorpamplona/amethyst/model/LocalCacheSearchParityTest.kt index 08e2c30f86..ddfb67e797 100644 --- a/amethyst/src/test/java/com/vitorpamplona/amethyst/model/LocalCacheSearchParityTest.kt +++ b/amethyst/src/test/java/com/vitorpamplona/amethyst/model/LocalCacheSearchParityTest.kt @@ -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 + } } }