Skip to content

ci(jest): Run setup-node-pnpm before the parallel setup group - #128035

Merged
natemoo-re merged 2 commits into
masterfrom
ci/jest-setup-node-pnpm-out-of-parallel
Oct 19, 2026
Merged

natemoo-re merged 2 commits into
masterfrom
ci/jest-setup-node-pnpm-out-of-parallel

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

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 through parallel: or background: write to shared job state that isn't thread-safe (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

via billy.

--

View Junior Session [Sentry]

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>
@sentry-junior
sentry-junior Bot requested a review from a team as a code owner October 19, 2026 15:34
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Oct 19, 2026
@billyvg
billyvg requested a review from scttcper October 19, 2026 15:50
@natemoo-re
natemoo-re enabled auto-merge (squash) October 19, 2026 17:02
@natemoo-re
natemoo-re merged commit 67e2564 into master Oct 19, 2026
88 checks passed
@natemoo-re
natemoo-re deleted the ci/jest-setup-node-pnpm-out-of-parallel branch October 19, 2026 17:09
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

1 active deployment
Preview — 21ba26d3 Deployed Oct 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants