Skip to content

fix(platform-ios): gracefully stop XCTest agent#139

Merged
V3RON merged 1 commit into
callstackincubator:mainfrom
mrousavy:codex/graceful-ios-harness-agent-shutdown
Jul 20, 2026
Merged

fix(platform-ios): gracefully stop XCTest agent#139
V3RON merged 1 commit into
callstackincubator:mainfrom
mrousavy:codex/graceful-ios-harness-agent-shutdown

Conversation

@mrousavy

@mrousavy mrousavy commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

What is this?

Harness now ends the iOS XCTest permission agent gracefully when a test run finishes, instead of immediately signalling xcodebuild to stop. Previously, normal teardown sent SIGTERM to the long-running xcodebuild test-without-building session while its UI test was still active, interrupting an otherwise-passing agent session and leaving stray simulator and xcodebuild processes behind.

How does it work?

The on-device XCTest agent gains a /shutdown endpoint. When it receives the request it flips an internal flag, its session loop exits on the next tick, and the UI test completes on its own so xcodebuild finishes and tears down its own child processes. During teardown the platform controller asks the agent to shut down first and waits, bounded by a timeout, for the process to exit. If the request fails or the agent does not stop in time, Harness falls back to the existing SIGTERM/SIGKILL termination. The shutdown timeout is raised to accommodate the slower-but-clean exit.

Why is this useful?

Test runs finish without cutting off a healthy agent session, and fewer orphaned simulator and xcodebuild processes survive teardown — reducing flakiness and resource leaks across consecutive iOS runs.

@vercel

vercel Bot commented Jun 3, 2026

Copy link
Copy Markdown

@mrousavy is attempting to deploy a commit to the Callstack Team on Vercel.

A member of the Team first needs to authorize it.

@V3RON
V3RON force-pushed the codex/graceful-ios-harness-agent-shutdown branch from 86f3b63 to 04befee Compare July 20, 2026 09:18
@V3RON
V3RON marked this pull request as ready for review July 20, 2026 09:18
@V3RON
V3RON merged commit 14bc398 into callstackincubator:main Jul 20, 2026
5 of 7 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