test(gateway): isolate the Feishu dedup persistence test from the operator's live store

test_concurrent_dedup_persists_land_in_order clears os.environ, which drops the per-test
HERMES_HOME; FeishuAdapter then resolves feishu_seen_message_ids.json under the operator's
real ~/.hermes and every id a running gateway has persisted lands in writes[-1] (265 extra
elements in the report). Keep HERMES_HOME through the wipe so the store stays in the sandbox.

Slim redo of #110708 (same fix, without re-indenting the test body).
This commit is contained in:
KoNit-K
2026-09-14 18:50:08 -07:00
committed by Teknium
parent 55266997e7
commit c8d8df41d2
+5 -1
View File
@@ -1709,7 +1709,11 @@ class TestDedupTTL(unittest.TestCase):
from gateway.config import PlatformConfig
from plugins.platforms.feishu.adapter import FeishuAdapter
adapter = FeishuAdapter(PlatformConfig())
# Keep the per-test HERMES_HOME through the env wipe: the adapter resolves its
# dedup store from get_hermes_home() at construction, and a cleared environment
# falls back to the operator's real ~/.hermes, whose live ids leak into writes[-1].
with patch.dict(os.environ, {"HERMES_HOME": os.environ["HERMES_HOME"]}, clear=True):
adapter = FeishuAdapter(PlatformConfig())
writes = []
calls = [0]