test(gateway): derive expected TimeoutStopSec from configured drain timeout#18972
Closed
Sanjays2402 wants to merge 1 commit into
Closed
test(gateway): derive expected TimeoutStopSec from configured drain timeout#18972Sanjays2402 wants to merge 1 commit into
Sanjays2402 wants to merge 1 commit into
Conversation
…imeout The generated systemd unit's TimeoutStopSec is computed by hermes_cli.gateway as max(60, _get_restart_drain_timeout()) + 30 to keep enough headroom over the agent's drain phase that systemd doesn't SIGKILL the cgroup before post-interrupt cleanup (tool-subprocess kill, adapter disconnect) runs — see issue NousResearch#8202. The default agent.restart_drain_timeout was bumped to 180s, which makes the unit emit TimeoutStopSec=210, but the assertions in ``test_{user,system}_unit_avoids_recursive_execstop_and_uses_extended_stop_timeout`` were still pinned to the previous ``TimeoutStopSec=90`` value. Compute the expected value from the same helper the unit generator uses, so the assertion tracks the configured default instead of hardcoding a stale literal. No production code change. Fixes the two assertion failures observed on ``main`` (run 25250051126).
This was referenced May 2, 2026
This was referenced May 2, 2026
Contributor
|
Closing as superseded by #19936. Triage notes (high confidence): Thanks for the contribution — the underlying problem this PR addresses has been resolved by the linked PR on current main. If you believe this was closed in error, please comment and we'll reopen. (Bulk-closed during a CLI PR triage sweep.) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes two
Testsfailures observed onmain(and therefore propagating to every open PR):Reference run: 25250051126 on
5d3be898a.Root cause
hermes_cli/gateway.py:1635computes:The default
agent.restart_drain_timeoutwas bumped to 180s, which makes the rendered systemd unit emitTimeoutStopSec=210. The two assertions inTestGeneratedSystemdUnitswere still pinned toTimeoutStopSec=90(formerly correct when the default was 60s), so they fail on every CI run.Fix
Compute the expected value from the same helper the unit generator uses:
…then assert
f"TimeoutStopSec={self._expected_timeout_stop_sec()}" in unit. The assertion now tracks the configured default rather than hardcoding a literal.Validation
Scope
system=Trueandsystem=Falseunits re-validatedOut of scope
The other ~13 main-CI failures (gateway-restart
killsemantics, dotenv vsos.environ, Dockerfile pid1, etc.) — happy to send those as separate focused PRs.