test(#3218): extend cache-eviction lock-discipline guard to the self-heal site (Opus NIT)

Opus advisor noted the static guard covered 4 of the 5 identity-mismatch
eviction sites; add the credential-self-heal pop/close pair so a future
re-lock of that path is caught by the gate too.
This commit is contained in:
nesquena-hermes
2026-05-31 00:26:59 +00:00
parent 5134d896ba
commit 634a70bebf
@@ -97,6 +97,7 @@ def test_identity_mismatch_cache_evictions_close_entries_outside_cache_lock():
"_stale_runtime_entry = SESSION_AGENT_CACHE.pop(session_id, None)",
"_skipped_agent_migration_entry = _cached_entry",
"evicted_cached_entry = _cfg.SESSION_AGENT_CACHE.pop(sid, None)",
"_evicted_entry = SESSION_AGENT_CACHE.pop(session_id, None)",
]
for marker in expected_markers:
assert marker in src
@@ -106,6 +107,7 @@ def test_identity_mismatch_cache_evictions_close_entries_outside_cache_lock():
"_close_cached_agent_entry_at_session_boundary(session_id, _stale_runtime_entry)",
"_close_cached_agent_entry_at_session_boundary(old_sid, _skipped_agent_migration_entry)",
"_close_cached_agent_entry_at_session_boundary(sid, evicted_cached_entry)",
"_close_cached_agent_entry_at_session_boundary(session_id, _evicted_entry)",
]
lines = src.splitlines()
for marker in close_markers: