Skip to content

test(restart_drain): assert i18n catalog resolved#27070

Closed
haran2001 wants to merge 1 commit into
NousResearch:mainfrom
haran2001:fix/restart-drain-i18n
Closed

test(restart_drain): assert i18n catalog resolved#27070
haran2001 wants to merge 1 commit into
NousResearch:mainfrom
haran2001:fix/restart-drain-i18n

Conversation

@haran2001

Copy link
Copy Markdown
Contributor

Summary

  • tests/gateway/test_restart_drain.py::test_restart_command_while_busy_requests_drain_without_interrupt previously asserted that the runner's reply equals t("gateway.draining", count=1). If the i18n catalog could not be resolved (e.g. an xdist worker losing the locales path — the original failure mode in fix(test): restart drain test fails after i18n migration #22266), t() returns the bare key "gateway.draining" instead of the formatted English string and both sides of the equality still match silently.
  • Add explicit guards that the resolved string is not the raw catalog key and contains the English Draining text plus the {count} substitution, so locale resolution failures fail loudly here instead of being masked.

Why test-only

The behavior bug in #22266 (test compared a hardcoded UI string to t(...)) was already fixed in commit a4289d74a fix(test): use i18n t() for restart drain assertion. The remaining gap is a regression hazard: the post-fix assertion happily passes even if i18n silently degrades. This PR keeps the existing assertion and adds the missing guardrail. No production code is touched.

Test Plan

  • python -m pytest tests/gateway/test_restart_drain.py -q -o 'addopts=' → 16 passed
  • python -m pytest tests/agent/test_i18n.py -q -o 'addopts=' → 43 passed

Duplicate PR check

Closes #22266

The restart-drain test previously asserted equality between two calls
to t("gateway.draining", count=1), which masked the original
xdist failure mode in NousResearch#22266: if the locale catalog is not resolved
from the worker's import path, t() returns the bare key path and
both sides of the equality still match.

Add a guard that the resolved value is not the raw catalog key and
contains the English placeholder substitution. This keeps the test
loudly failing when locale resolution silently degrades.
@cardtest15-coder

This comment was marked as spam.

@alt-glitch alt-glitch added type/test Test coverage or test infrastructure P3 Low — cosmetic, nice to have comp/gateway Gateway runner, session dispatch, delivery labels May 16, 2026
teknium1 added a commit that referenced this pull request May 17, 2026
…tors

Adds release-note attribution mappings for the contributors from group 5:
- @haran2001 (PR #27070, #27068)
- @ms-alan (PR #26443)
- @godlin-gh (PR #26118)
- @wesleysimplicio (PR #25777, ext-email form)
- @Carry00 (PR #26851)
- @alaamohanad169-ship-it (PR #26036)
- @hawknewton (PR #26294)

(YanzhongSu PR #25879 and flamiinngo PR #27231 already mapped.)
@teknium1

Copy link
Copy Markdown
Contributor

Merged via PR #27382 — your commit was cherry-picked onto current main as part of a batch salvage of low-risk new-contributor PRs. Authorship preserved (test(restart_drain): assert i18n catalog resolved (#22266)). Thanks for the contribution.

@teknium1 teknium1 closed this May 17, 2026
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have type/test Test coverage or test infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(test): restart drain test fails after i18n migration

4 participants