Skip to content

test: faster full test runs (draft, for CI timing) - #879

Draft
cpojer wants to merge 4 commits into
mainfrom
test-speed
Draft

cpojer wants to merge 4 commits into
mainfrom
test-speed

Conversation

@cpojer

@cpojer cpojer commented Nov 18, 2026

Copy link
Copy Markdown
Member

Draft opened only to observe CI timing for the test-speed branch; not ready for review.

  • Split the three longest browser suites into one file per variant.
  • Run real cf subprocess unit tests concurrently within each file.
  • Let the cached platform runtime build be a cache hit.
  • Shard estimates and TESTING.md notes for the above.

Local vpr test:all (M4 Pro, warm build cache): 248s → 193s.

🤖 Generated with Claude Code

cpojer and others added 4 commits November 18, 2026 23:37
page-errors, server-auth-errors and http-errors-playground each ran every
variant (framework, sign-in state, dev/production) one after another in one
file, so each held a worker for 50-67 seconds. The suite body now lives in a
*-suite.ts module and one small test file per variant calls it, so the
variants run in parallel workers. Every test still runs, with its own fixture
copy and server as before.

Measured alone on a 12-core M4 Pro:
  page-errors            67s -> 4 files, longest 18s
  server-auth-errors     52s -> 3 files, longest 21s
  http-errors-playground 68s -> 2 files, longest 26s

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
cf-version-runner, cf-build-output, cf-version-transport and
cloudflare-operation-process spend their time waiting for real child
processes, one test at a time. Their tests now run concurrently
(Vitest's default of five at once). Each test already has its own
temporary directory and local API server.

To make that safe:
- Tests that use `vi` stay serial through `serialIt`. They patch globals,
  and Vitest clears every mock's call history when another test starts.
- Shared cleanup lists are drained when the file ends, not after each test.
- Tests read their own project root with `outputRoot(prepared)` instead of
  the last entry of the shared `roots` list.
- The cloudflare-operation-process files join the cli-unit project, which
  gets a 20-second test timeout on every platform: a test now also waits
  while its neighbours block the thread in a synchronous spawn.

Measured alone on a 12-core M4 Pro:
  cloudflare-operation-process  31s -> 5s
  cf-version-runner             44s -> 22s
  cf-build-output               22s -> 11s
  cf-version-transport          18s -> 6s

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
`vp run --cache build:all` reran packages/platform's runtime build (about
6 seconds) on every invocation. The build empties dist/runtime before
writing it, which the task cache records as reading those files, and the
uncached `build:stamp` step then edits the manifest in that directory. The
runtime build's own output therefore always looked like a changed input.

The step is now a `build:runtime` task that excludes dist/runtime from its
inputs. Its real inputs (sources, the API build, migrations) are still
tracked automatically.

Measured on a 12-core M4 Pro, `vp run --cache build:all` with nothing
changed: 14s -> 8s.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…timates

The split browser files had no entry in the timing table, so the
longest-first sequencer and the CI shard balancer treated each as a
5s file.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://test-speed-void-cloud.voidzero-docs.workers.dev (commit 246d1c9)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://454e3438-void-cloud.voidzero-docs.workers.dev 246d1c9 2026-11-18T15:20:44.803Z Visit the dashboard ↗

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant