diff --git a/tests/gateway/test_goal_verdict_send.py b/tests/gateway/test_goal_verdict_send.py index 9c24526c51..08b4ec1c7b 100644 --- a/tests/gateway/test_goal_verdict_send.py +++ b/tests/gateway/test_goal_verdict_send.py @@ -30,6 +30,15 @@ def hermes_home(tmp_path, monkeypatch): from hermes_cli import goals goals._DB_CACHE.clear() + # Pre-warm the SessionDB cache from this SYNC context. The tests call + # GoalManager.set() on the event-loop thread, where _get_session_db() + # refuses to construct SessionDB inline (loop-liveness guard) and only + # waits _DB_BOOTSTRAP_LOOP_WAIT_S for a background bootstrap. On a loaded + # CI runner the init overruns that window, the goal write is silently + # dropped by design, and the continuation path no-ops — the recurring + # sends == [] flake. Warming here uses the direct construction path, so + # the loop-thread set() always finds a cached DB. + goals._get_session_db() yield home goals._DB_CACHE.clear()