Repository navigation
fix(ci): Keep event-file readers out of parallel and background steps - #127616
Merged
Merged
Conversation
Contributor
|
🚨 Warning: This pull request contains Frontend and Backend changes! It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently. Have questions? Please ask in the |
scttcper
approved these changes
Oct 16, 2026
The runner truncates and rewrites $GITHUB_EVENT_PATH every time a step starts (actions/runner#4641). actions/setup-node, pnpm/action-setup, actions/download-artifact and dawidd6/action-download-artifact parse that file when they start, so running them next to a `parallel:` group or a `background:` step intermittently fails with "SyntaxError: Unexpected end of JSON input". Move setup-node and pnpm/action-setup into a setup-node-toolchain composite. The jest job and the acceptance job run it before their concurrent steps start, and setup-node-pnpm skips it via `setup-toolchain: 'false'`. The jest job's two artifact downloads become one `gh` script, which doesn't read the event file and retries transient artifact API errors. Fixes #127566 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
billyvg
force-pushed
the
billyvg/ci/fix-event-json-race
branch
from
October 16, 2026 18:15
b81fde2 to
cf5f0ed
Compare
billyvg
marked this pull request as ready for review
October 16, 2026 18:25
RudraPatel2003
pushed a commit
that referenced
this pull request
Oct 19, 2026
…#127616) ### Why? Jest shards and acceptance jobs sometimes fail before any tests run, with `SyntaxError: Unexpected end of JSON input`. The runner truncates and rewrites `$GITHUB_EVENT_PATH` every time a step starts (actions/runner#4641). Meanwhile `actions/setup-node`, `pnpm/action-setup`, `actions/download-artifact` and `dawidd6/action-download-artifact` parse that file when they start. The jest job now sets up inside a `parallel:` group, and acceptance runs `setup-sentry` as a `background:` step, so those actions sometimes read the file while another step is rewriting it. The issue has the evidence and failure counts. - Fixes #127566 ### How? Node and pnpm are installed before anything runs concurrently. The jest artifact downloads are replaced with a `gh` script, which doesn't read the event file and retries transient artifact API errors. After this change, nothing that reads the event file runs while other steps are running. ### Decisions - **Keep `parallel:` and `background:` rather than reverting them.** - Jest: setup takes about as long as before (22s here, against 21s for a master shard). - Acceptance: the background step now starts about 12s later, once Node and pnpm are installed. That only costs time when the webpack cache is warm, because then the background step is already the slowest path. On this PR's run, setup before tests took a median of 128s, against medians of 119–128s across recent master runs. - **A failed balance download fails the shard** after retries instead of warning and continuing. A shard without `jest-balance.json` splits tests by file name while the other shards split by duration, so some tests would silently never run. <sub>Generated with Claude Code</sub> Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2 tasks done
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.
Why?
Jest shards and acceptance jobs sometimes fail before any tests run, with
SyntaxError: Unexpected end of JSON input. The runner truncates and rewrites$GITHUB_EVENT_PATHevery time a step starts (actions/runner#4641). Meanwhileactions/setup-node,pnpm/action-setup,actions/download-artifactanddawidd6/action-download-artifactparse that file when they start. The jest job now sets up inside aparallel:group, and acceptance runssetup-sentryas abackground:step, so those actions sometimes read the file while another step is rewriting it. The issue has the evidence and failure counts.How?
Node and pnpm are installed before anything runs concurrently. The jest artifact downloads are replaced with a
ghscript, which doesn't read the event file and retries transient artifact API errors. After this change, nothing that reads the event file runs while other steps are running.Decisions
parallel:andbackground:rather than reverting them.jest-balance.jsonsplits tests by file name while the other shards split by duration, so some tests would silently never run.Generated with Claude Code