fix(edge): Chrome tear-down never fails a job, and never leaves an orphan - #84
Merged
Merged
Conversation
…phan Two ways the browser used by export/verify could hurt a run that had succeeded: 1. close() deleted Chrome's temp profile 120ms after SIGTERM, while Chrome's helpers were still writing into it. rmSync threw ENOTEMPTY out of a `finally`, turning a successful export into a failed one. Now it waits for the process to exit, retries the delete, and a leftover temp folder is swallowed — it is never worth failing a job over. 2. Killing only the spawned pid left a headless Chrome orphaned for 21 minutes after a launch that timed out. Chrome now starts in its own process group and tear-down kills the group, in both the timeout path and close(). Verified: 6/6 launch→inspect→close cycles clean; 3 forced launch timeouts; zero stray Chromes and zero leftover profiles after both. Full src/cli/cmd suite 1537/0; reference suite 28/28. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K9LZmfMCptv6tUqxryDrTx
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.
close() raced Chrome's helpers and threw ENOTEMPTY out of a finally (a successful export could exit non-zero); a launch timeout orphaned a headless Chrome. Now: wait for exit, retry the delete, swallow a leftover temp dir; process-group kill. 6/6 clean cycles, 3 forced timeouts, zero strays. src/cli/cmd 1537/0.
🤖 Generated with Claude Code