Skip to content

test(cli): Drain subprocess output concurrently - #34

Merged
philprime merged 2 commits into
mainfrom
philprime/test/subprocess-output-capture
Sep 24, 2026
Merged

philprime merged 2 commits into
mainfrom
philprime/test/subprocess-output-capture

Conversation

@philprime

@philprime philprime commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Extract noninteractive subprocess capture from feature/tui. Integration tests keep stdout and stderr separate, disable child-process telemetry, and use macOS 13-compatible synchronization.

Concurrency
Stderr drains on a dedicated thread. Scheduling the reader on the global dispatch queue could deadlock when synchronous Swift Testing callers occupied every cooperative worker. A 32-case concurrent regression reproduced the macOS CI hang, and a process sample confirmed all workers were blocked waiting for queued readers.

Verification
The regression now passes on macOS and Linux. make test, make analyze, make build, and live CLI integration tests passed locally. All actionable CI checks passed, including macOS and Linux tests and all four release build targets. This PR changes only test infrastructure.

Keep stderr separate without deadlocking on full pipes, disable telemetry in child processes, and use macOS 13-compatible synchronization. Exercise large stderr, output separation, and exit failures with local subprocess fixtures.
@philprime
philprime marked this pull request as ready for review September 24, 2026 18:44
@philprime
philprime enabled auto-merge (squash) September 24, 2026 18:45
Drain stderr on a dedicated thread so synchronous test callers cannot occupy every worker needed by the reader. Exercise 32 concurrent subprocesses to reproduce the macOS CI deadlock before the fix.
@philprime
philprime merged commit b9c3016 into main Sep 24, 2026
15 checks passed
@philprime
philprime deleted the philprime/test/subprocess-output-capture branch September 24, 2026 19:19
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