Conversation
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2b131e3f3a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (isRunnerProcessAlive(session.child.pid)) { | ||
| await killRunnerProcessTree(session.child.pid, 'SIGKILL'); |
There was a problem hiding this comment.
Preserve forced tree cleanup after runner PID exits
This guard can leak descendant runner processes when the xcodebuild leader exits before its process group is fully gone (for example after a crash or partial shutdown): isRunnerProcessAlive only checks the leader PID, so killRunnerProcessTree is skipped entirely in that case. The skipped call previously sent kill(-pid, ...) and pkill -P pid, which are the only teardown steps here that target lingering descendants; without them, stale XCTest/simulator helper processes can survive and interfere with later sessions.
Useful? React with 👍 / 👎.
2b131e3 to
6296fe6
Compare
6296fe6 to
7c41660
Compare
Summary
Guard iOS runner teardown so the process tree is only SIGKILLed when the xcodebuild runner process or its process group is still alive after graceful shutdown.
This avoids unnecessary process-tree signals after XCTest has already exited cleanly while preserving cleanup for lingering runner descendants. The process-group liveness check is shared through
process-identity.Validation
pnpm format
pnpm vitest run src/utils/tests/process-identity.test.ts
pnpm typecheck
Touched files: 3
Scope remained within runner teardown/process identity helpers.