Repository navigation
ci(jest): Run setup-node-pnpm before the parallel setup group - #128035
Merged
Merged
Conversation
Composite actions that overlap other steps can corrupt shared runner state and fail the job before tests start with 'Collection was modified; enumeration operation may not execute' (actions/runner#4789). Install dependencies before the parallel group so only the transform cache and artifact download run concurrently. Co-Authored-By: Billy Vong <billy@sentry.io>
billyvg
approved these changes
Oct 19, 2026
natemoo-re
approved these changes
Oct 19, 2026
natemoo-re
enabled auto-merge (squash)
October 19, 2026 17:02
RudraPatel2003
pushed a commit
that referenced
this pull request
Oct 19, 2026
Jest shards sometimes fail before any test runs, with `Collection was modified; enumeration operation may not execute.` while the runner prepares `./.github/actions/setup-node-pnpm` ([example on master](https://github.com/getsentry/sentry/actions/runs/39267071826/job/118109778239)). It's a runner bug: composite actions that overlap other steps through `parallel:` or `background:` write to shared job state that isn't thread-safe ([actions/runner#4789](actions/runner#4789)). A rerun passes. `setup-node-pnpm` now runs on its own before the parallel group, with its default toolchain install, which replaces the separate `setup-node-toolchain` step. The parallel group keeps only the jest transform cache (a regular `actions/cache` step) and the artifact download script. Neither is a composite action, so they don't share that state. This adds the node_modules cache restore to the serial path, a few seconds per shard on a cache hit. The `background: true` `setup-sentry` step in `acceptance.yml` is also a composite action that overlaps other steps, so it could hit the same race. This PR leaves it alone. Refs #127566 <!-- junior-request-attribution:start --> via **billy**. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:slack%3AC8V02RHC7%3A1792419486.342589 --> -- [View Junior Session](https://junior-prod.sentry.dev/conversations/slack%3AC8V02RHC7%3A1792419486.342589) [[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC8V02RHC7%3A1792419486.342589/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: Billy Vong <billy@sentry.io>
This branch was successfully deployed
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.
Jest shards sometimes fail before any test runs, with
Collection was modified; enumeration operation may not execute.while the runner prepares./.github/actions/setup-node-pnpm(example on master). It's a runner bug: composite actions that overlap other steps throughparallel:orbackground:write to shared job state that isn't thread-safe (actions/runner#4789). A rerun passes.setup-node-pnpmnow runs on its own before the parallel group, with its default toolchain install, which replaces the separatesetup-node-toolchainstep. The parallel group keeps only the jest transform cache (a regularactions/cachestep) and the artifact download script. Neither is a composite action, so they don't share that state.This adds the node_modules cache restore to the serial path, a few seconds per shard on a cache hit.
The
background: truesetup-sentrystep inacceptance.ymlis also a composite action that overlaps other steps, so it could hit the same race. This PR leaves it alone.Refs #127566
via billy.
--
View Junior Session [Sentry]