fix(tests): set _ever_connected in reconnect-scenario test mocks

These pre-existing tests fake a successful first connect by calling
only _ready.set(), which is what the real code did before this PR.
Now that run() gates the initial-vs-reconnect branch on the new sticky
_ever_connected flag instead, their later simulated reconnect failures
were misclassified as never-connected and hit the 3-attempt ladder,
failing test_reconnect_counter_resets_after_successful_session,
test_parked_server_self_probes_and_revives, and
test_retry_attempts_log_debug_transitions_warn in CI. Set the flag
alongside _ready.set() to mirror the real success sites, same as the
new test added in tools/mcp_tool.py's own PR.
This commit is contained in:
chelsealong
2026-08-25 11:40:43 +00:00
committed by Teknium
parent c7673f322b
commit e8dc0af5b1
3 changed files with 3 additions and 0 deletions
@@ -88,6 +88,7 @@ def test_parked_server_self_probes_and_revives(monkeypatch, tmp_path):
# First connect succeeds (sets _ready), then dies.
self.session = object()
self._ready.set()
self._ever_connected = True
self.session = None
raise RuntimeError("backend outage begins")
if not state["backend_up"]:
@@ -68,6 +68,7 @@ def test_retry_attempts_log_debug_transitions_warn(monkeypatch, tmp_path, caplog
if state["transport_calls"] == 1:
self.session = object()
self._ready.set()
self._ever_connected = True
self.session = None
raise ConnectionError("backend down")
@@ -62,6 +62,7 @@ def test_reconnect_counter_resets_after_successful_session(monkeypatch, tmp_path
# First connect: succeed (sets _ready), then fail.
self.session = object()
self._ready.set()
self._ever_connected = True
self.session = None
raise RuntimeError("blip 1")