From fee3d4ed04f3849f7610c1324cf0613a25842733 Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Tue, 30 Jun 2026 03:07:39 -0700 Subject: [PATCH] test(gateway): update startup-restart-race fixtures for current main The salvaged test double predated two main changes: - start() now connects via _connect_adapter_with_timeout, which forwards is_reconnect to adapter.connect(); the StartupRaceAdapter double didn't accept the kwarg. - stop() now awaits _finalize_shutdown_agents (async on main); the fixture stubbed it as a plain MagicMock. Accept is_reconnect in the double and use AsyncMock for the finalize stub. --- tests/gateway/test_startup_restart_race.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/gateway/test_startup_restart_race.py b/tests/gateway/test_startup_restart_race.py index 3696b1cec..e303cba1c 100644 --- a/tests/gateway/test_startup_restart_race.py +++ b/tests/gateway/test_startup_restart_race.py @@ -27,7 +27,7 @@ class StartupRaceAdapter(BasePlatformAdapter): self.disconnected = False self.background_cancelled = False - async def connect(self): + async def connect(self, *, is_reconnect: bool = False): if self.on_connect: self.on_connect() if self.wait_for_disconnect is not None: @@ -98,7 +98,7 @@ def make_startup_runner(tmp_path): runner._suspend_stuck_loop_sessions = MagicMock(return_value=0) runner._notify_active_sessions_of_shutdown = AsyncMock() runner._drain_active_agents = AsyncMock(return_value=({}, False)) - runner._finalize_shutdown_agents = MagicMock() + runner._finalize_shutdown_agents = AsyncMock() runner._send_update_notification = AsyncMock(return_value=False) runner._schedule_update_notification_watch = MagicMock() runner._send_restart_notification = AsyncMock()