Skip to content

Commit 92f69d0

Browse files
authored
ci: stabilize flaky Test job (cap nx parallelism + raise vitest timeouts) (#478)
* test(devtools): raise vitest timeouts to stop flaky component test:lib in CI The component tests added in #472 render the full Solid + goober tree and take 1-4s locally. Shared CI runners are ~4x slower (the suite runs in ~8s locally but ~31s in CI), which pushes individual tests past vitest's default 5s testTimeout and causes intermittent `@tanstack/devtools:test:lib` failures across unrelated PRs (e.g. #471, #477). Raise testTimeout and hookTimeout to 30s for the devtools package so slow CI runs have headroom. Fast unit tests are unaffected; a real hang still fails (just after 30s instead of 5s). * 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 e026667 commit 92f69d0

2 files changed

Lines changed: 12 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

packages/devtools/vite.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ const config = defineConfig({
1313
environment: 'jsdom',
1414
setupFiles: ['./tests/test-setup.ts'],
1515
globals: true,
16+
// Component tests render the full Solid + goober tree (see src/**/*.test.tsx).
17+
// These take 1-4s locally but run on shared CI runners that are ~4x slower,
18+
// pushing individual tests past vitest's default 5s timeout and causing
19+
// flaky `test:lib` failures. Give them headroom; fast tests are unaffected.
20+
testTimeout: 30_000,
21+
hookTimeout: 30_000,
1622
},
1723
})
1824

0 commit comments

Comments
 (0)