From 26062d09de797d76a1e1f209567d9a43dc3cdf91 Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Sun, 19 Apr 2026 18:37:32 +0100 Subject: [PATCH] ci: speed up package tests by enabling parallel execution Remove --concurrency=1 from the packages test CI command, letting Turbo parallelize package test suites across available cores. Package tests are well-isolated and safe to run in parallel: - Wrangler: in-process tests with MSW mocks, runInTempDir(), mocked ports - Miniflare: forks pool with maxWorkers=1, port 0, package-local .tmp/ - vitest-pool-workers: private Verdaccio on random port, isolated temp dirs - All other packages: lightweight unit tests with no shared resources Validated locally: 4 consecutive runs with unlimited concurrency, all 34/34 tasks passing with zero retries. Execution time drops from ~9.5min (serial) to ~2min (parallel). --- .github/workflows/test-and-check.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-and-check.yml b/.github/workflows/test-and-check.yml index 446177017d7..159c796b930 100644 --- a/.github/workflows/test-and-check.yml +++ b/.github/workflows/test-and-check.yml @@ -140,7 +140,8 @@ jobs: if: steps.changes.outputs.everything_but_markdown == 'true' && matrix.suite == 'packages-and-tools' # We skip @cloudflare/vitest-pool-workers tests in CI on Windows because they're very flaky. We still run the vitest-pool-workers-examples fixture, which is a comprehensive set of example tests and gives us a lot of confidence. # The @cloudflare/vitest-pool-workers tests skipped are things like watch mode, which constantly times out probably due to the github runners in use. - run: pnpm run test:ci --log-order=stream --concurrency=1 --filter="./packages/*" ${{ matrix.os == 'windows-latest' && '--filter="!./packages/vitest-pool-workers"' || '' }} + # Package tests are well-isolated (separate processes, temp dirs, random ports, MSW mocks) and can safely run in parallel. + run: pnpm run test:ci --log-order=stream --filter="./packages/*" ${{ matrix.os == 'windows-latest' && '--filter="!./packages/vitest-pool-workers"' || '' }} env: NODE_OPTIONS: "--max_old_space_size=8192" WRANGLER_LOG_PATH: ${{ runner.temp }}/wrangler-debug-logs/