Repository navigation
ci: the timed tests measure tests, not compilation - #130
Merged
Merged
Conversation
The test-time budget (10 s per test) measured compilation too: on the 2-vCPU runner the timed go test compiled packages and ran while lint, the generators, the release smoke and deploy/ compiled in parallel, so an unchanged test (packages/auth TestBetterAuthScryptHash, 4.4-5.6 s on main) took 10.3-12.1 s on a PR adding a large cold dependency. The test task now builds and links every test binary first (untimed, same -race -cover instrumentation, run as `true`), waits for the other tasks, then runs the timed go test with the CPUs to itself. No budget changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… waiting Waiting for every other task before the timed run cost ~2 s on a typical PR (the tests' own run became the critical path). Running the other tasks at nice 19 keeps them overlapping while the tests get the CPUs whenever they want them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d run gets the CPUs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jayleaton
marked this pull request as ready for review
October 23, 2026 11:15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The 10 s per-test budget (
scripts/testbudget) was measuring compilation as well as tests. On the 2-vCPU runner the timedgo test -race -jsoncompiled packages and ran tests while lint, the generators, the release smoke anddeploy/compiled in parallel. On #114, which adds a 2.7 MB generated WebP codec that main's build cache has never compiled,packages/authTestBetterAuthScryptHash(unchanged by #114) took 10.3–12.1 s and failed the budget, against 4.4–5.6 s on main. Re-running can't fix it, because only main pushes save the build cache, and any PR that adds a heavy dependency would hit the same thing.Summary
The timed tests still overlap the other tasks, but those tasks now only get the CPU time the tests leave. AGENTS.md "Fast tests / Budgets" says so in one sentence.
I measured two other designs and rejected them:
Evidence
#114 combined. A scratch PR put #114's two commits (
9eaf2f6,c5d06db) on this fix, so its affected set matched #114's own PR. I did not push to #114, and I deleted the scratch branches afterwards.TestBetterAuthScryptHashIn that combined run, the test-build took 16.9 s (cold codec) and overlapped lint (37 s), the generators (31 s), smoke (39 s) and mobile (42 s). The timed run took 9.8 s.
Wall time of the
cijob. Each row is one PR re-run 3–5 times (separate runs land on different machines).apps/web/internal/services: job, 5 runsworkflow_dispatch): job, 3 runsThe typical-PR critical path is smoke, and smoke's time is dominated by Postgres boot: every 15–17 s smoke waited 45–54 readiness checks. That happened in 1 of 5 runs before and 2 of 5 after, which accounts for most of the raw +3 s difference. Comparing like with like (Postgres ready quickly), the Check step is the same. The timed test run itself takes 1.6–2.0 s on the typical PR.
make check-fastpassed.Merge Danger
Door: two-way. Only
scripts/ci-check.shand one AGENTS.md sentence change. Revert to restore the old scheduling.Blast Radius: CI
Every
cirun now builds the test binaries once untimed, then relinks them for the timed run; a warm relink costs under 1 s for two packages. Lint, smoke, mobile and the rest run at nice 19, so they can finish a little later on runs where the tests are busy. No budgets changed.🤖 Generated with Claude Code