Skip to content

driver-sql: live-DDL work still on vitest's 5000ms default outside #13902's scoping — 4 it() blocks beyond declareDialectCell, and 2 beforeAll hooks #14100

Description

@claude

Filed while implementing #13902 (its A2.3 instruction: report same-shaped live-DDL tests
outside the card's scoping before folding any in). Unassigned: recording only.

#13902 scoped itself to it(...) blocks nested in a declareDialectCell(...) callback, and
that scoping was right for what it fixed. Two adjacent populations in the same package do the
same live connect/DDL work on vitest's inherited 5000ms default and fall outside it. Both were
found structurally (TypeScript AST over packages/drivers/driver-sql/src/*.test.ts), and the
instrument carries a firing control: the same walk returns the 2 budgets that landed on
sql-driver-13056-orphan-shadow-column-cleanup.test.ts, so a zero elsewhere is a reading
rather than a broken expression.

Population A — live-DDL it() outside declareDialectCell(...)

Four it(...) blocks construct a driver against a live Postgres cell and carry no explicit
budget. Classified by reading each new SqlDriver(...) argument rather than by inferring from
the enclosing file:

Location Gate Driver config
live-dialect-matrix.isolation.test.ts:281 it.skipIf(!PG_CELL.available) PG_CELL.config()
live-dialect-matrix.isolation.test.ts:314 it.skipIf(!PG_CELL.available) PG_CELL.config()
sql-driver-autonumber-cold-race.test.ts:159 it.skipIf(!pgCell.available) pgCell.config()
sql-driver-json-binding-without-ddl.test.ts:173 it { ...PG_CELL.config(), schemaMode: 'validate-only' }

The first two also call initObjects(...), so they are the full connect/DDL/read-back shape
#13688 measured. The other 42 outside-cell it()s that construct a driver are embedded SQLite
(dialectCell('sqlite').config() or a better-sqlite3 :memory: literal) and are correctly on
the fast default — they are not part of this.

Population B — unbudgeted beforeAll hooks doing live connect + DDL + writes

sql-driver-backend-fault-envelope.test.ts has two beforeAll hooks that each open a live
driver, run initObjects(...), and insert rows:

  • :160new SqlDriver(cell.config()), two drop table if exists, initObjects(...), 2 creates
  • :343new SqlDriver(cell.config()), drop table if exists, initObjects(...), 1 create

Neither carries a budget, so both inherit the 5000ms default for work that is strictly heavier
than the it()s they feed. #13902 correctly excluded this file's two it() blocks (they only
query an already-open connection), but excluding the it()s left the file's real live cost
unbudgeted — the cost simply lives in the hook.

The package already answers this shape elsewhere: sql-driver-diagnostic-value-probe.test.ts:335
carries }, 60_000) on exactly this kind of beforeAll. Measured across the package, 5 of the
6 hook-level budgets are 60_000.

Why this is a separate card rather than a rider

Different unit of change (a hook budget, and a population outside the card's wrapper), and the
two interact: whether Population B wants hook budgets or something else affects the cost-model
argument #13902 used to exclude those files' it() blocks. Folding either into #13902's PR
would have been the silent package-wide creep that card's own dispatch order ruled out.

Related


Generated by Claude Code

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions