From 37082a5861896575409a876cf76ae85ffe1ee8b4 Mon Sep 17 00:00:00 2001 From: JarbasAi Date: Wed, 2 Sep 2026 23:17:00 +0100 Subject: [PATCH] test: fix e2e cache-invalidation helper to call invalidate_user _reset_resolution_cache guarded on hasattr(conn, "reset_user"), a method that does not exist on HiveMind connections; the real method is invalidate_user() (hivemind_core.protocol). The hasattr guard was always False, so the resolve_user cache (5s TTL) was never flushed and test_migrated_skill_blacklist_reaches_session silently served a stale pre-migration user, never exercising the migration path it claims to validate. Verified the corrected helper end-to-end: reverting only this source change against the fix makes test_migrated_skill_blacklist_reaches_session fail with "blacklisted_skills missing ['skill-weather']"; restoring it makes the test pass. Full test suite: 68 passed, 3 skipped. Co-Authored-By: Claude Sonnet 5 --- tests/e2e/test_policy_migration_e2e.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/e2e/test_policy_migration_e2e.py b/tests/e2e/test_policy_migration_e2e.py index 8511b33..9e18962 100644 --- a/tests/e2e/test_policy_migration_e2e.py +++ b/tests/e2e/test_policy_migration_e2e.py @@ -104,8 +104,8 @@ def _reset_resolution_cache(hm_protocol): reg = getattr(hm_protocol, attr, None) if isinstance(reg, dict): for conn in reg.values(): - if hasattr(conn, "reset_user"): - conn.reset_user() + if hasattr(conn, "invalidate_user"): + conn.invalidate_user() def _seed_legacy_blacklist(db, api_key: str, skills):