Skip to content

fix: avoid killing stopped ios runner#460

Merged
thymikee merged 1 commit intomainfrom
codex/guard-ios-runner-teardown
Apr 28, 2026
Merged

fix: avoid killing stopped ios runner#460
thymikee merged 1 commit intomainfrom
codex/guard-ios-runner-teardown

Conversation

@thymikee
Copy link
Copy Markdown
Contributor

@thymikee thymikee commented Apr 28, 2026

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.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 28, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://callstackincubator.github.io/agent-device/pr-preview/pr-460/

Built to branch gh-pages at 2026-04-28 19:48 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/platforms/ios/runner-session.ts Outdated
Comment on lines +195 to +196
if (isRunnerProcessAlive(session.child.pid)) {
await killRunnerProcessTree(session.child.pid, 'SIGKILL');
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@thymikee thymikee force-pushed the codex/guard-ios-runner-teardown branch from 2b131e3 to 6296fe6 Compare April 28, 2026 19:45
@thymikee thymikee force-pushed the codex/guard-ios-runner-teardown branch from 6296fe6 to 7c41660 Compare April 28, 2026 19:47
@thymikee thymikee merged commit 994ee78 into main Apr 28, 2026
18 checks passed
@thymikee thymikee deleted the codex/guard-ios-runner-teardown branch April 28, 2026 19:49
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