Skip to content

test(node): give the stderr-replay wait margin past its heartbeat - #1446

Open
joei4cm wants to merge 1 commit into
EverMind-AI:mainfrom
joei4cm:test/node_stderr_detach_margin
Open

joei4cm wants to merge 1 commit into
EverMind-AI:mainfrom
joei4cm:test/node_stderr_detach_margin

Conversation

@joei4cm

@joei4cm joei4cm commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Summary

test_a_reason_written_on_stderr_while_the_link_was_down_reaches_the_run_watching_it
failed twice in a row on the unit (py3.12 / ubuntu-latest / 4/4) shard of an
unrelated PR (#1439), both times at test_node_stderr_replay.py:364:

AssertionError: did not happen in time
ERROR: agents left running under the stand-in machine's daemon

The wait asks for endpoint.detached within _until's 10 s default, but the
flag is set by _heartbeat -> _lost -> _drop, which waits a heartbeat tick
plus the link-loss window and then runs through the event loop. Under shard
load the signal lands past 10 s; the test then fails, and the agent the turn
was still waiting for trips the teardown guard. The check waits on an
observable condition (detached is not None), not on how fast the heartbeat
loop happens to turn, so the wait gets margin past the heartbeat, not a longer
poll: timeout=30, the parameter _until already takes
(test_subagent_cli_remote.py:403 uses timeout=5).

Test-only change; no production code moves.

Type

  • Other (tests)

Verification

  • uv run --frozen pytest tests/test_node_stderr_replay.py -q -n 0 -k "reason_written" --tb=short -> 1 passed

  • uv run --frozen pytest tests/test_node_stderr_replay.py::test_a_reason_written_on_stderr_while_the_link_was_down_reaches_the_run_watching_it -q -n 0 (x3) -> passed each time

  • Relevant tests pass locally

  • Relevant lint / type checks pass locally

  • User-facing docs or screenshots are updated when needed

Risk

  • Security impact considered
  • Backward compatibility considered
  • Rollback path is clear for risky changes

Related Issues

N/A

@joei4cm

joei4cm commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

This one is ready for review when you get a moment. Fixes the flake signature hit twice on #1439's CI.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant