hermes - 💡(How to fix) Fix fix(test): restart drain test fails after i18n migration

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

The test asserts against a hardcoded string ("⏳ Draining 1 active agent(s) before restart..."), but gateway/run.py was migrated to use the i18n system: t("gateway.draining", count=count).

In the xdist test environment, t() may return the raw key ("gateway.draining") instead of the localized string if the locale catalog at locales/en.yaml is not resolved from the worker's import path.

Fix Action

Fix

Assert against t("gateway.draining", count=1) instead of the hardcoded string. This produces the correct expected value regardless of locale resolution in the test environment.

Code Example

FAILED tests/gateway/test_restart_drain.py::test_restart_command_while_busy_requests_drain_without_interrupt
  -Draining 1 active agent(s) before restart...
  + gateway.draining
RAW_BUFFERClick to expand / collapse

Bug

test_restart_command_while_busy_requests_drain_without_interrupt in tests/gateway/test_restart_drain.py fails on main:

FAILED tests/gateway/test_restart_drain.py::test_restart_command_while_busy_requests_drain_without_interrupt
  - ⏳ Draining 1 active agent(s) before restart...
  + gateway.draining

Root Cause

The test asserts against a hardcoded string ("⏳ Draining 1 active agent(s) before restart..."), but gateway/run.py was migrated to use the i18n system: t("gateway.draining", count=count).

In the xdist test environment, t() may return the raw key ("gateway.draining") instead of the localized string if the locale catalog at locales/en.yaml is not resolved from the worker's import path.

Fix

Assert against t("gateway.draining", count=1) instead of the hardcoded string. This produces the correct expected value regardless of locale resolution in the test environment.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING