CircleCI parallelism set but tests not split across nodes in CI
Setting parallelism: N spins up N containers, but each one runs the full suite unless you split the test list with circleci tests split. The job is N times the cost with no speedup, and may flake on shared resources.
What this error means
With parallelism greater than 1, every node runs the same tests; total time does not drop and the same tests appear in every container log.
# parallelism: 4, but each node runs the entire suite
Running 1200 tests on node 0
Running 1200 tests on node 1 # should be a subsetCommon causes
No splitting step
Parallelism only allocates containers; without circleci tests split, each node receives the full file list.
Splitting output not passed to the runner
The split file list is computed but not actually handed to the test command, so the runner ignores it.
How to fix it
Split the test list per node
- Glob the test files.
- Pipe them through
circleci tests split(optionally by timings). - Pass the resulting subset to the test runner.
- run:
command: |
TESTS=$(circleci tests glob "test/**/*.spec.js" \
| circleci tests split --split-by=timings)
npx jest $TESTSStore results so timing-based splits work
Upload JUnit results so future runs split by timings for balanced nodes.
- store_test_results:
path: ./reportsHow to prevent it
- Always pair
parallelismwithcircleci tests split. - Pass the split subset to the test command, not the full glob.
- Store test results to enable split-by-timings.