Skip to content
Latchkey

CircleCI Test Splitting Errors - Fix parallelism & globbing

Test splitting across parallel containers is misconfigured - the glob matches nothing on some containers, the runner ignores the split list, or every container runs the full suite. The job fails or wastes minutes.

What this error means

Some parallel containers report "no tests found" while others run everything, or the same tests run on every container. Results are inconsistent across the parallel runs even though the code is unchanged.

job log
Running tests in parallel across 4 containers
circleci tests glob "test/**/*.spec.js"
No files match the glob, or split produced an empty list for this container.

Common causes

Glob matches nothing on a container

With more containers than test files, some containers get an empty split and report no tests. The glob pattern may also be wrong relative to the working directory.

Split output not passed to the runner

circleci tests split only prints a file list; if the test command does not consume that list, each container runs the entire suite.

parallelism not set or set to 1

Splitting only helps when parallelism is greater than 1 and the splitter knows the count. With parallelism: 1 there is nothing to split.

How to fix it

Wire splitting into the test command

.circleci/config.yml
jobs:
  test:
    docker: [{ image: cimg/node:20.11 }]
    parallelism: 4
    steps:
      - checkout
      - run: npm ci
      - run:
          name: Run tests (split by timing)
          command: |
            TESTS=$(circleci tests glob "test/**/*.spec.js" | circleci tests split --split-by=timings)
            npx jest $TESTS

Right-size parallelism to the suite

  1. Keep parallelism at or below the number of test files/groups.
  2. Verify the glob matches files from the job’s working directory.
  3. Store timing data (store_test_results) so --split-by=timings balances evenly.

How to prevent it

  • Always feed the split list into the actual test runner.
  • Use --split-by=timings with store_test_results for even splits.
  • Keep parallelism proportional to the number of test files.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →