From c8d8df41d2c4a8bad5b01f256a7296eb1e599683 Mon Sep 17 00:00:00 2001 From: KoNit-K <124019182+KoNit-K@users.noreply.github.com> Date: Mon, 14 Sep 2026 18:50:08 -0700 Subject: [PATCH] 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). --- tests/gateway/test_feishu.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/gateway/test_feishu.py b/tests/gateway/test_feishu.py index 369c7113a0..8612cd776d 100644 --- a/tests/gateway/test_feishu.py +++ b/tests/gateway/test_feishu.py @@ -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]