Skip to content

Commit b2c1742

Browse files
committed
ci: cap nx parallelism to 3 to fix flaky Test job
nx.json sets `parallel: 5`, which is fine for local dev machines but oversubscribes GitHub-hosted runners: each affected `test:lib` (vitest) and `test:types` (tsc) task spawns its own worker pool, so 5 heavy tasks at once exhaust CPU/RAM and intermittently stall or OOM-kill deterministic tasks. That produced flaky failures across unrelated PRs (#471, #477, #478) that pass on a plain re-run. The team already pins `test:e2e` to `--parallel=1` for the same reason; cap the Test job's nx parallelism via NX_PARALLEL=3 (CI-only, leaves local dev at 5). Combined with the raised vitest timeouts, this keeps tasks within the runner's budget.
1 parent aaa71f6 commit b2c1742

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

.github/workflows/pr.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ concurrency:
99

1010
env:
1111
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
12+
# nx.json sets parallel: 5 for local dev machines. GitHub-hosted runners have
13+
# far fewer cores/RAM, and each test:lib (vitest) / test:types (tsc) task
14+
# spawns its own worker pool. Running 5 such heavy tasks at once oversubscribes
15+
# the runner and intermittently OOM-kills or stalls tasks, producing flaky
16+
# failures that pass on re-run. Cap CI parallelism to keep tasks within budget.
17+
NX_PARALLEL: 3
1218

1319
permissions:
1420
contents: read

0 commit comments

Comments
 (0)