Skip to content

test: don't require a heartbeat write before a report ends the shell - #439

Merged
ChrisKrawczyk merged 1 commit into
mainfrom
test/workflow-shell-heartbeat-race
Dec 1, 2026
Merged

ChrisKrawczyk merged 1 commit into
mainfrom
test/workflow-shell-heartbeat-race

Conversation

@ChrisKrawczyk

Copy link
Copy Markdown
Collaborator

Two tests in workflow-agent-memory-worker.test.js proved a background shell had started by checking that its heartbeat file existed. Under parallel load, the step's report can end the child session about 0.1 s after the shell starts, before the shell's first write. The check then fails even though the product behaved correctly: the shell started and was ended.

Release run 46608675841 (v0.8.22) hit this once in its initial baseline run, on "a background shell started in the report's own message ends too". The case passed its sequential verification.

Changes:

  • Prove the start from the bash tool result (command started in background).
  • Prove the end by the heartbeat file not growing over 1.5 s. A missing file counts as size 0.
  • Apply this to both tests; the sibling test had the same latent race.

A shell that kept running still fails the test, because its file would grow during the pause.

Validation: the whole file passed on Linux (15/15), and npm run lint passed.

Two workflow memory tests proved a background shell had started by
checking that its heartbeat file existed. Under parallel load the report
can end the child session about 0.1 s after the shell starts, before its
first write, so the check failed even though the shell started and was
ended. Release run 46608675841 hit this once.

Prove the start by the bash tool result ("command started in
background") and the end by the heartbeat file not growing over 1.5 s.
A shell that kept running would still fail the test.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: cc944a13-3e0b-43de-8040-5863182bbdb0
@ChrisKrawczyk
ChrisKrawczyk merged commit 24bdf90 into main Dec 1, 2026
5 checks passed
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.

2 participants