Repository navigation
perf(ci): a database per Postgres test - #344
Merged
Merged
Conversation
The `pg_*` tier was serialised by construction, and this is the pair of changes that unserialises it. Measured on `er-server` at CI's 4-core concurrency: **259.5s -> 35.9s, 7.2x**, same 153 tests. ## Why it was serial Every `pg_*.rs` connected to the one database named by `ER_TEST_PG_DSN`, `DROP TABLE ... CASCADE`-ed its way to a clean slate and rebuilt. Because that schema is shared, `pg_serial.rs` had to forbid a second `#[tokio::test]` per file — and because cargo runs one test BINARY at a time, 41 single-test binaries ran strictly one after another. That was 170s of the `DuckLake + extensions e2e` job spent waiting rather than working. The shared schema was the cause, not an inherent constraint. ## A database, not a schema Per-schema isolation looks like the obvious fix and is the wrong one here: the generated DDL is hard-qualified (`CREATE TABLE IF NOT EXISTS public.orgs`) with `STORE = "public"` on every entity, so parameterising the schema means changing the entity framework and 114 generated files. A database per test needs none of that — `public.*` stays `public.*`, in its own database. `tests/common/mod.rs` creates it. Deliberately **empty**, with each test still calling `pg::ensure_schema` itself: bootstrap is part of what several of these tests exercise, so cloning a pre-built template would quietly stop testing it. `CREATE DATABASE ... TEMPLATE` is the next step if that ever dominates, but it is an optimisation and not the point. This also deletes 32 hand-maintained `DROP TABLE` lists that had already drifted into **ten** distinct variants across 35 files — a list that is wrong in the silent direction, since a table missing from it survives into the next test. Two of them carried comments explaining cross-test interference they existed to dodge (`pg_train`'s colliding `pair_labels` pkey, `pg_webhook_deliver`'s global oldest-first `claim` picking up another run's orphan). Those comments are kept, rewritten to record that isolation is what removes the problem. ## `pg_serial.rs` stays, for a new reason The rule survives but its justification changed, so the file says so. `fresh_db` keys the database on one slug per FILE, so two tests in a file would now both ask for the same database and the second `DROP DATABASE ... WITH (FORCE)` would disconnect the first mid-test. The race moved from the tables to the database; it did not go away. `fresh_db` also asserts against a double call in-process, which is the half the source scanner cannot see. ## nextest `cargo test` cannot overlap test binaries, so the isolation alone buys nothing — hence both halves in one change. `cargo nextest run` puts every test in its own process out of one global pool. Wired into the `test` and `ducklake-e2e` jobs and into the `Makefile`'s `check`/`check-e2e` so local and CI agree. Installed by a version-pinned download rather than a third-party action, because every `uses:` in this workflow is SHA-pinned. nextest does **not** run doctests. `make test` and the `test` job therefore carry a separate `cargo test --doc` step; it costs under a second, and dropping it would lose that coverage silently. ## Measured, including where it does not help | | before | after | | |---|---|---|---| | `er-server` suite, `-j4` | 259.5s | **35.9s** | 7.2x | | full `check-e2e` test time, `-j4` | 333s | 246.7s | -26% | The second row is the honest one. The pg tier parallelises almost perfectly because it is latency-bound, but the DuckLake tests are CPU-bound and simply saturate 4 cores — `lake_e2e.rs` alone is 112s of CPU across 40 tests. More concurrency cannot help those; more machines can, which makes sharding that one file the next thing worth pricing rather than anything in this change. Counts reconcile exactly against the pre-change baselines: `make check` 583 -> **586** and `check-e2e` 229 -> **232**, the +3 being `db_per_test.rs`. Both gates green, and the no-DSN path still skips cleanly so the `test` job (which has no Postgres) is unaffected. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Replaces the hand-rolled version-pinned download. `taiki-e/install-action` is
already used a few jobs down for `cargo-llvm-cov`, SHA-pinned, and tracked by
dependabot — so the justification in the comment I removed ("rather than a
third-party action, to keep every `uses:` SHA-pinned") was simply wrong about
this repo. It fetches a prebuilt binary either way.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
A/B on CI with comparable cache state (`fmt + clippy + docs` identical at 1.1m in both runs, which is what makes the rest comparable): | job | cargo | nextest | | |---|---|---|---| | `test` | 9.0m | 10.8m | **+1.8m** | | `DuckLake + extensions e2e` | 15.5m | 15.2m | −0.2m (noise) | Step-level, the whole delta is the runner: 357s for `cargo test --workspace` against 453s for `cargo nextest run --workspace`. The install step costs 1s and the extra doctest step 5s, so neither explains it. The cause is process-per-test. cargo spawns one process per test BINARY (~147); nextest spawns one per TEST (586), and every spawn loads a binary that statically links bundled DuckDB. At roughly 100-200ms of spawn-and-load each that is ~60-120s, which is the +96s. So the earlier reasoning was backwards. nextest wins where tests are few and slow — the Postgres tier is exactly that, and it went 259.5s -> 35.9s at `-j4` locally. It loses where tests are many and fast with large binaries, which is this workspace as a whole. A 7x win on one tier does not survive being averaged with a per-test tax on 586 of them. The isolation from the previous commit stays, and is worth having on its own: it removes the shared-schema race, deletes ten drifted `DROP TABLE` lists, and is the prerequisite for the thing that should actually collect the win — consolidating the per-file test binaries so cargo's own in-binary threads do the overlapping, with no process tax and ~72 fewer uncacheable links. Both gates re-verified on cargo: `make check` 586 passed, `check-e2e` 232 passed, zero skips. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
athvin
pushed a commit
that referenced
this pull request
Oct 28, 2026
Extends the same `autotests = false` pattern to the twelve other crates with more than one integration-test file: dedupe-cli, er-cli, er-compile, er-entity-gen, er-entity-lint, er-hash, er-ingest, er-reconcile, er-schema, er-standardize, er-std. Test binaries across the workspace go **147 -> 56**. ## One crate is deliberately left out, and it took a failure to find `er-entity-diff` is NOT consolidated. Its `pg_diff.rs` and `pg_reconcile.rs` both connect to the single database named by `ER_TEST_PG_DSN`, so as modules of one binary they ran concurrently against shared tables and Postgres returned `E40P01 deadlock detected` — one test waiting on AccessShareLock on the schema while the other held AccessExclusiveLock on a relation it was retyping. I had scanned every candidate crate for concurrency hazards before starting, but only for temp-file and working-directory collisions — not for a shared Postgres, because the database-per-test isolation (#344) lives in er-server's test support and I did not think to ask which *other* crate talks to that database. It is two links; the reason it stays separate, and what would have to happen first, is recorded in its Cargo.toml rather than left to be rediscovered. ## Measured | | main | after | |---|---|---| | test binaries linked | 147 | **56** | | `check-e2e` test time | 346s | **194s** (−44%) | CI on the previous commit (the big three only) already showed the effect on job wall-clock, against two independent controls with `fmt + clippy + docs` as the control variable: `test` 9.0m/10.2m -> 8.2m, `DuckLake e2e` 15.5m/17.4m -> 13.6m. Roughly −10% to −20% on both long jobs. Modest rather than dramatic, because what remains in both is dependency-tree compile, which only the cache can touch. `make check` 586 passed and `check-e2e` 232 passed, both unchanged from main, zero skips. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
athvin
added a commit
that referenced
this pull request
Oct 28, 2026
…them (#345) * perf(ci): one test binary per crate for the three that carry most of them sccache reports `Non-cacheable reasons: crate-type 147` — it cannot cache a final link, so the workspace's ~147 test binaries were compiled and linked uncached on every run of every CI job, each one statically linking bundled DuckDB. That is a floor no amount of cache work gets under, and it is the largest single cost in both long jobs. `autotests = false` plus one explicit `[[test]]` target per crate makes every file in `tests/` a module of `tests/main.rs` instead of a target of its own, for the three crates holding 76 of the 117 integration files: er-server 49, dedupe-core 20, er-match 7. **Files do not move.** That is the point of doing it with `autotests` rather than by relocating sources into a subdirectory: all 40 `include_str!` paths and the `CARGO_MANIFEST_DIR`-relative fixture helpers keep resolving, and git history stays attached to each file. ## Measured, same machine, back to back | | before | after | | |---|---|---|---| | test binaries linked (`cargo test --workspace`) | 147 | **75** | −49% | | er-server: compile lib + link its test targets | 52.6s | **13.4s** | 3.9× | | er-server suite wall | 259.5s | **30.6s** | 8.5× | | `check-e2e` test time | 346s | 210s | −39% | | `check-e2e` test time at CI's 4 threads | 346s | 256s | −26% | The suite win is the same overlap `cargo nextest` was meant to buy: cargo runs one test BINARY at a time, so these files ran strictly in series, and as modules of one binary they are threads in one process. Unlike nextest there is no process-per-test tax — nextest was measured 96s *slower* on the `test` job for exactly that reason (#344) — and unlike nextest this also removes 72 uncacheable links. One change, both costs. This is only safe because each Postgres test owns its own database (#344); before that, 49 concurrent threads on one shared schema is precisely the race `pg_serial.rs` exists to prevent. dedupe-core and er-match needed no equivalent work: their fixtures are read-only committed files, verified by grepping for writers. ## Consequences worth knowing `--test <file>` no longer resolves for these three crates; the target is `main` and the old file name is a name filter. Updated at all three call sites — rust.yml's extension-loading step and the 50k scale job, plus the ducklake-lakehouse skill. `er-cli --test lake_e2e` is untouched because er-cli is not consolidated. `pg_serial.rs` keeps doing its job unchanged: it scans `tests/` for `pg_*.rs` files, which are still there. Counts are identical to main: `make check` 586 passed, `check-e2e` 232 passed, zero skips. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * perf(ci): consolidate the remaining multi-file test crates Extends the same `autotests = false` pattern to the twelve other crates with more than one integration-test file: dedupe-cli, er-cli, er-compile, er-entity-gen, er-entity-lint, er-hash, er-ingest, er-reconcile, er-schema, er-standardize, er-std. Test binaries across the workspace go **147 -> 56**. ## One crate is deliberately left out, and it took a failure to find `er-entity-diff` is NOT consolidated. Its `pg_diff.rs` and `pg_reconcile.rs` both connect to the single database named by `ER_TEST_PG_DSN`, so as modules of one binary they ran concurrently against shared tables and Postgres returned `E40P01 deadlock detected` — one test waiting on AccessShareLock on the schema while the other held AccessExclusiveLock on a relation it was retyping. I had scanned every candidate crate for concurrency hazards before starting, but only for temp-file and working-directory collisions — not for a shared Postgres, because the database-per-test isolation (#344) lives in er-server's test support and I did not think to ask which *other* crate talks to that database. It is two links; the reason it stays separate, and what would have to happen first, is recorded in its Cargo.toml rather than left to be rediscovered. ## Measured | | main | after | |---|---|---| | test binaries linked | 147 | **56** | | `check-e2e` test time | 346s | **194s** (−44%) | CI on the previous commit (the big three only) already showed the effect on job wall-clock, against two independent controls with `fmt + clippy + docs` as the control variable: `test` 9.0m/10.2m -> 8.2m, `DuckLake e2e` 15.5m/17.4m -> 13.6m. Roughly −10% to −20% on both long jobs. Modest rather than dramatic, because what remains in both is dependency-tree compile, which only the cache can touch. `make check` 586 passed and `check-e2e` 232 passed, both unchanged from main, zero skips. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> --------- Co-authored-by: bmoore813 <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
athvin
added a commit
that referenced
this pull request
Oct 28, 2026
…t applied) (#346) * perf(ci): one test binary per crate for the three that carry most of them sccache reports `Non-cacheable reasons: crate-type 147` — it cannot cache a final link, so the workspace's ~147 test binaries were compiled and linked uncached on every run of every CI job, each one statically linking bundled DuckDB. That is a floor no amount of cache work gets under, and it is the largest single cost in both long jobs. `autotests = false` plus one explicit `[[test]]` target per crate makes every file in `tests/` a module of `tests/main.rs` instead of a target of its own, for the three crates holding 76 of the 117 integration files: er-server 49, dedupe-core 20, er-match 7. **Files do not move.** That is the point of doing it with `autotests` rather than by relocating sources into a subdirectory: all 40 `include_str!` paths and the `CARGO_MANIFEST_DIR`-relative fixture helpers keep resolving, and git history stays attached to each file. ## Measured, same machine, back to back | | before | after | | |---|---|---|---| | test binaries linked (`cargo test --workspace`) | 147 | **75** | −49% | | er-server: compile lib + link its test targets | 52.6s | **13.4s** | 3.9× | | er-server suite wall | 259.5s | **30.6s** | 8.5× | | `check-e2e` test time | 346s | 210s | −39% | | `check-e2e` test time at CI's 4 threads | 346s | 256s | −26% | The suite win is the same overlap `cargo nextest` was meant to buy: cargo runs one test BINARY at a time, so these files ran strictly in series, and as modules of one binary they are threads in one process. Unlike nextest there is no process-per-test tax — nextest was measured 96s *slower* on the `test` job for exactly that reason (#344) — and unlike nextest this also removes 72 uncacheable links. One change, both costs. This is only safe because each Postgres test owns its own database (#344); before that, 49 concurrent threads on one shared schema is precisely the race `pg_serial.rs` exists to prevent. dedupe-core and er-match needed no equivalent work: their fixtures are read-only committed files, verified by grepping for writers. ## Consequences worth knowing `--test <file>` no longer resolves for these three crates; the target is `main` and the old file name is a name filter. Updated at all three call sites — rust.yml's extension-loading step and the 50k scale job, plus the ducklake-lakehouse skill. `er-cli --test lake_e2e` is untouched because er-cli is not consolidated. `pg_serial.rs` keeps doing its job unchanged: it scans `tests/` for `pg_*.rs` files, which are still there. Counts are identical to main: `make check` 586 passed, `check-e2e` 232 passed, zero skips. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * perf(ci): consolidate the remaining multi-file test crates Extends the same `autotests = false` pattern to the twelve other crates with more than one integration-test file: dedupe-cli, er-cli, er-compile, er-entity-gen, er-entity-lint, er-hash, er-ingest, er-reconcile, er-schema, er-standardize, er-std. Test binaries across the workspace go **147 -> 56**. ## One crate is deliberately left out, and it took a failure to find `er-entity-diff` is NOT consolidated. Its `pg_diff.rs` and `pg_reconcile.rs` both connect to the single database named by `ER_TEST_PG_DSN`, so as modules of one binary they ran concurrently against shared tables and Postgres returned `E40P01 deadlock detected` — one test waiting on AccessShareLock on the schema while the other held AccessExclusiveLock on a relation it was retyping. I had scanned every candidate crate for concurrency hazards before starting, but only for temp-file and working-directory collisions — not for a shared Postgres, because the database-per-test isolation (#344) lives in er-server's test support and I did not think to ask which *other* crate talks to that database. It is two links; the reason it stays separate, and what would have to happen first, is recorded in its Cargo.toml rather than left to be rediscovered. ## Measured | | main | after | |---|---|---| | test binaries linked | 147 | **56** | | `check-e2e` test time | 346s | **194s** (−44%) | CI on the previous commit (the big three only) already showed the effect on job wall-clock, against two independent controls with `fmt + clippy + docs` as the control variable: `test` 9.0m/10.2m -> 8.2m, `DuckLake e2e` 15.5m/17.4m -> 13.6m. Roughly −10% to −20% on both long jobs. Modest rather than dramatic, because what remains in both is dependency-tree compile, which only the cache can touch. `make check` 586 passed and `check-e2e` 232 passed, both unchanged from main, zero skips. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * feat(infra): terraform the sccache S3 bucket and its two CI roles NOT APPLIED, and rust.yml is deliberately untouched. Pointing the workflow at the bucket before `terraform apply` runs would make every compile job fail to assume a role that does not exist, so the sequence is: merge this, apply, then switch the workflow in its own change. ## Why sccache currently uses the GitHub Actions cache backend, which shares one 10 GB per-repository budget, LRU-evicted past it. That is why rust.yml carries a nightly `cache-prune` job — a cap on the thing doing most of the work. When the repository sat at the ceiling GitHub evicted its largest LRU victim, the rust-cache entry every compile job restores from, producing cold runs with no dependency change to explain them. Cold is roughly 3x: on DuckDB 2.0 the `DuckLake e2e` job measured 25m cold against 8m warm, `test` 15m against 6m. This is now the dominant remaining CI lever. After collapsing 147 test binaries to 56 (#345), what is left in both long jobs is dependency-tree compile, which only a cache can touch — consolidation got `test` to 8.2m and `DuckLake e2e` to 13.6m, and more test-structure work would be diminishing returns. ## The security decision in this change Two roles, not one, because **this repository is public**. A role that let any PR-triggered job write to the cache would be a path for a contributor-supplied branch to place compiled object code that a later `main` build consumes — cache poisoning straight into the build. So `er-ci-sccache-write` trusts only `ref:refs/heads/main`, exactly as the existing `er-ci-ecr-push` role restricts image pushes and as rust.yml's rust-cache config already restricts its single writer ("`lint` is the SINGLE WRITER of `shared-key: rust`, and only from `main`"). `er-ci-sccache-read` trusts any ref of this repository, so PRs read the cache `main` populated — which is where nearly all the value is, the dependency tree rather than the PR's own crates. Neither policy carries `s3:DeleteObject`; expiry is the lifecycle rule's job. Fork PRs get neither role: GitHub issues no `id-token` to a fork's `pull_request` run, so those have no cache. That is the safe failure and not a regression, since the Actions backend was equally unavailable to them. **One thing is unverified and the comment says so.** sccache is *expected* to treat a denied `PutObject` as a non-fatal cache-write miss and keep compiling. If it instead fails the build, the read-only role is unusable and the choice becomes one read+write role (accepting the poisoning surface) or no cache on PRs. Probe that on a single PR before deleting `cache-prune`. ## Notes The bucket is private, SSE-AES256, unversioned (every object is a content-addressed compilation result, so a second version is the same bytes), with a 14-day expiry that replaces the nightly prune and a 1-day abort-incomplete-multipart rule so a killed runner cannot leave billable uploads behind. The `github-oidc` module gains an `oidc_provider_arn` output: an account may hold only one OIDC provider per issuer URL and that module owns it, so these roles federate against the existing ARN rather than declaring a second provider (which would fail with EntityAlreadyExists). `terraform fmt -check -recursive` passes. I could not run `terraform validate` locally — my provider setup validates credentials at init and fails identically on unmodified `main`, so it is environmental — and infra.yml's credential-free `validate each env` job is the authority. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * feat(infra): measure the read-only-cache assumption instead of asserting it The two-role split only works if sccache treats a denied cache write as a non-fatal miss. That was the one unverified precondition in this change, so I measured it rather than leaving it as a caveat: sccache 0.19.0 against a read-only cache directory, compiling a source change the cache could not satisfy, exits 0 and reports `Cache write errors 1`, `Cache errors 0`, `Compilation failures 0`. Kept one caveat honestly: the probe used the local-disk backend, not S3. The failure is handled at the same backend-agnostic `storage.put()` boundary, so this is strong evidence rather than proof that an S3 403 behaves the same way — hence the note to watch `Cache write errors` on the first PR run after the switch. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * chore(infra): regenerate the account footprint for the sccache resources `.claude/skills/aws-account-operations/references/footprint.md` is GENERATED from `infra/terraform/` — it counts resource types — so adding sccache.tf made it stale and both the `agent skills (lint + drift)` and `fmt + clippy + docs` jobs failed on it. My miss: on this branch I ran `terraform fmt` and leaned on infra.yml's validate, and never ran the repo-wide `make skills-check`. The terraform was fine; the generated doc derived from it was not. The inventory now reads aws_iam_role 9 -> 11, aws_iam_role_policy 6 -> 8, aws_s3_bucket 5 -> 6, plus the bucket's access-block/encryption/lifecycle entries. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> --------- Co-authored-by: bmoore813 <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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.
Gives every Postgres test its own database. This is a correctness and
enablement change, not a speedup — see the measurement section for the
negative result that reshaped it.
Why the tier was serial
Every
pg_*.rsconnected to the one database named byER_TEST_PG_DSN,DROP TABLE ... CASCADE-ed its way to a clean slate and rebuilt. Because thatschema is shared,
pg_serial.rshad to forbid a second#[tokio::test]perfile — and because cargo runs one test BINARY at a time, 41 single-test binaries
ran strictly one after another: 170s of the
DuckLake + extensions e2ejobspent waiting rather than working.
The shared schema was the cause, not an inherent constraint.
A database, not a schema
Per-schema isolation looks like the obvious fix and is the wrong one here: the
generated DDL is hard-qualified (
CREATE TABLE IF NOT EXISTS public.orgs) withSTORE = "public"on every entity, so parameterising the schema means changingthe entity framework and 114 generated files. A database per test needs none of
that —
public.*stayspublic.*, in its own database.tests/common/mod.rscreates it. Deliberately empty, with each test stillcalling
pg::ensure_schemaitself: bootstrap is part of what several of thesetests exercise, so cloning a pre-built template would quietly stop testing it.
This also deletes 32 hand-maintained
DROP TABLElists that had already driftedinto ten distinct variants across 35 files — a list that is wrong in the
silent direction, since a table missing from it survives into the next test. Two
carried comments explaining cross-test interference they existed to dodge
(
pg_train's collidingpair_labelspkey,pg_webhook_deliver's globaloldest-first
claimpicking up another run's orphan). Those are kept, rewrittento record that isolation is what removes the problem.
pg_serial.rsstays, for a new reasonThe rule survives but its justification changed, so the file says so.
fresh_dbkeys the database on one slug per FILE, so two tests in a file would now both ask
for the same database and the second
DROP DATABASE ... WITH (FORCE)woulddisconnect the first mid-test. The race moved from the tables to the database; it
did not go away.
fresh_dbalso asserts against a double call in-process, whichis the half a source scanner cannot see.
The measurement, including the part that failed
I first paired this with
cargo nextestand claimed a large win. The CI A/B didnot support it, and the honest numbers are why nextest is not in this PR.
Run against run with comparable cache state —
fmt + clippy + docscame outidentical at 1.1m in both, which is what makes the rest comparable:
testDuckLake + extensions e2eStep-level the whole delta is the runner: 357s for
cargo test --workspaceagainst 453s for
cargo nextest run. The install step costs 1s, the extradoctest step 5s.
The cause is process-per-test. cargo spawns one process per test binary
(~147); nextest spawns one per test (586), and every spawn loads a binary that
statically links bundled DuckDB — roughly 100–200ms each, so ~60–120s, which is
the +96s.
So my reasoning had been backwards. nextest wins where tests are few and slow
(the Postgres tier, 259.5s → 35.9s at
-j4locally) and loses where they aremany and fast with large binaries, which is this workspace overall. A 7×
improvement on one tier does not survive being averaged with a per-test tax on
586 of them.
An earlier comparison I nearly published was worse than useless: it showed e2e
22m → 15m, but
entitieswent 8m → 3m andfmt6m → 1m in the same pair —jobs this change does not touch. That was cache warmth, not the change.
What it costs today
Measured on one machine with
cargo teston both sides, so no cache or runnervariance is involved:
check-e2etest timepg_*portionThat is ~0.34s per test — the
DROP DATABASE+CREATE DATABASEround trip,which is what replaced the
DROP TABLEreset. So this PR makes the suitemarginally slower on its own. It is worth landing for the correctness result
and because Phase 3 cannot be done safely without it; it does not pay for itself
until those tests can overlap.
For scale: CI run-to-run variance on these jobs is 1–2 minutes, so this 13s is
well below the noise floor there and should not be looked for in job timings.
What this unlocks instead
Consolidating the per-file test binaries, so cargo's own in-binary threads
do the overlapping: no process tax, and ~72 of the 147 uncacheable
crate-typelinks disappear with them. sccache reports those 147 asnon-cacheable by construction — it can never cache a final link — so they are a
floor no cache work can get under. That needs this isolation first, which is
what this PR is for.
Counts reconcile exactly:
make check583 → 586 andcheck-e2e229 →232, the +3 being
db_per_test.rs. Both gates green on cargo, zero skips,and the no-DSN path still skips cleanly so the
testjob (which has noPostgres) is unaffected.
🤖 Generated with Claude Code