Repository navigation
refactor(test): reuse process-death waits in PTY tests - #174221
Merged
Merged
Conversation
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
vincentkoc
marked this pull request as ready for review
October 16, 2026 12:52
vincentkoc
enabled auto-merge (squash)
October 16, 2026 12:59
Member
Author
|
Merged via squash auto-merge.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Oct 17, 2026
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.
What Problem This Solves
The PTY tests duplicate the shared process-death wait instead of using its existing cancellation and cleanup contract.
User Impact
No user-visible change. Both PTY suites and every assertion remain; production code is unchanged.
Why This Change Was Made
Replace two identical local wait loops with
waitForDead, retaining the test-owned abort signal and explicit descendant-death assertions. PTY exit reports the shell's lifetime, so the separate adopted-descendant check still matters.The shared helper observes death once more before rejecting an abort and polls every 5 ms instead of 10 ms. It adds no deadline or retry budget. Existing helper tests cover abort diagnostics, real process death, zombie detection, and timer/listener settlement.
This removes 26 net test lines across two files, with no cases, assertions, platform gates, or production lines removed.
Evidence
c4f6442eed0f12bdfb4d9844726eebcd362dee28: every retained statement, test case, and assertion is equivalent after the wait-call rename.git diff --check: passed.node scripts/run-vitest.mjs src/process/terminal-pty.test.ts src/process/terminal-pty-bun.test.ts test/helpers/process-wait.test.ts --maxWorkers=1: 27 passed / 14 platform-runtime skips on Node; 35 passed / 6 platform-runtime skips on the checksum-pinned OpenClaw Bun fork. All eight native Bun PTY cases ran and passed, including the slave-holding descendant case.The signed commit
11aa707ef5ecf89209db3271af956d8206132df1has the exact tested tree0a15ce8752f2e935053b48f388ce1b3efecfff7e. The test payload passed; the delegated Actions run was cancelled during lease cleanup. An initial cleanup settlement read failed, then the same native lease-stop route reconciled successfully without rerunning tests.The remaining skips cover Windows-only cases and the stock-Bun fallback route, neither changed here. Required exact-head CI owns broader compiler and platform proof.