From a4289d74ac99694350497fb01b15aba63ce9ffde Mon Sep 17 00:00:00 2001 From: alblez <914199+alblez@users.noreply.github.com> Date: Tue, 12 May 2026 18:49:27 -0700 Subject: [PATCH] fix(test): use i18n t() for restart drain assertion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test_restart_command_while_busy_requests_drain_without_interrupt test was asserting against a hardcoded emoji string that was valid before the i18n migration. After gateway/run.py switched to t("gateway.draining", count=N), the test sees the translated output (or the raw key when the locale catalog isn't resolved in xdist workers). Fix by asserting against t("gateway.draining", count=1) — this produces the correct expected value regardless of whether the locale file is available in the test environment. --- tests/gateway/test_restart_drain.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/gateway/test_restart_drain.py b/tests/gateway/test_restart_drain.py index 55de5a45544..844af427308 100644 --- a/tests/gateway/test_restart_drain.py +++ b/tests/gateway/test_restart_drain.py @@ -7,6 +7,7 @@ from unittest.mock import AsyncMock, MagicMock import pytest import gateway.run as gateway_run +from agent.i18n import t from gateway.platforms.base import MessageEvent, MessageType from gateway.restart import DEFAULT_GATEWAY_RESTART_DRAIN_TIMEOUT from gateway.session import SessionEntry, build_session_key @@ -32,7 +33,7 @@ async def test_restart_command_while_busy_requests_drain_without_interrupt(monke result = await runner._handle_message(event) - assert result == "⏳ Draining 1 active agent(s) before restart..." + assert result == t("gateway.draining", count=1) running_agent.interrupt.assert_not_called() runner.request_restart.assert_called_once_with(detached=True, via_service=False)