Uh oh!
There was an error while loading. Please reload this page.
test(driver-sql): budget the live-DDL work outside #13902's scoping — 4 it() and 2 beforeAll hooks - #14212
Merged
os-support-ai merged 2 commits intoSep 1, 2026
Conversation
Four it() blocks that build a live-Postgres SqlDriver outside a declareDialectCell(...) callback, and the two beforeAll hooks in sql-driver-backend-fault-envelope.test.ts that open a live driver, run initObjects(...) and insert rows, all inherited vitest's 5000ms default. Each now carries an explicit 60_000, per-site — no package-level testTimeout, and the 39 embedded-SQLite sites are left on the fast default. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q5WBDtaUnoz5XuJ6jk8pQ5
An unbudgeted beforeAll inherits hookTimeout (measured: 10000ms in this package's config), not testTimeout's 5000ms. Ablation legs B1/B3/B4 in the PR body. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q5WBDtaUnoz5XuJ6jk8pQ5
Contributor
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs. What this run could not see
Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
os-support-ai
marked this pull request as ready for review
September 1, 2026 13:24
os-support-ai
enabled auto-merge
September 1, 2026 13:24
Uh oh!
There was an error while loading. Please reload this page.
os-support-ai
deleted the
claude/issue-14100-live-ddl-budgets-outside-scoping
branch
September 1, 2026 13:50
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 freeto 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.
Fixes#14100
Adds an explicit
60_000budget to the six live-DDL sites inpackages/drivers/driver-sqlthat #13902 / PR #14098 correctly left outside its own scoping. Per-site, per-hook — no
package-level
testTimeout, novitest.config.tschange, no production source.Diff: 4 test files, 6 budgets, nothing else.
What changed
Population A — 4
it()blocks that build a live-PostgresSqlDriveroutside adeclareDialectCell(...)callback:live-dialect-matrix.isolation.test.ts— "index introspection reports the indexes that exist in the file's schema"PG_CELL.config()+initObjects(...)live-dialect-matrix.isolation.test.ts— "schema introspection lists a table created in the file's schema"PG_CELL.config()+initObjects(...)sql-driver-autonumber-cold-race.test.ts— "leaves the surrounding transaction usable after a statement error"pgCell.config()+ create/drop probe tablesql-driver-json-binding-without-ddl.test.ts— "§3 a datasource we are a guest in…"PG_CELL.config()plusschemaMode: 'validate-only', builds a SECOND live driverPopulation B — the 2
beforeAllhooks insql-driver-backend-fault-envelope.test.ts(the
declareSweephook, and the Postgres-only hook), each opening a live driver, runninginitObjects(...)and inserting rows. The file'sit()blocks stay unbudgeted on purpose:they only query an already-open connection, so #13902's exclusion of them was right — the
live cost simply lives in the hook.
Correction: hooks do NOT inherit the 5000ms default
The card states both hooks "inherit the 5000ms default". Measured here, that is wrong.
A hook inherits
hookTimeout, nottestTimeout:it(), 6000ms, no budgetTest timed out in 5000ms(5.58s)it(), 6000ms,60_000beforeAll, 6000ms, no budgetbeforeAll, 11000ms, no budgetHook timed out in 10000ms(10.56s)beforeAll, 11000ms,60_000it(), 11000ms,60_000So the unbudgeted hooks were on a 10000ms ceiling, not 5000ms. The fix still stands and
still matters (10s is the wrong ceiling for a live connect plus schema-sync DDL plus inserts,
and B4 proves the third argument does lift a hook), but the number is corrected in the code
comment rather than repeated. This package sets no
testTimeoutorhookTimeoutanywhere,so both defaults are vitest's own.
Ablation discipline: probes were written into the package, their landing on disk proven by
marker and budget occurrence counts (never an editor exit code), each leg run through the
shared verify lock with the exit code captured by redirect before any pipe, and the probes
removed by an
EXIT INT TERMtrap with absence re-proven andgit statusshown clean.The judgement gate (③), answered per site
Question: is any existing red a timeout itself rather than an assertion, and — critically —
does any assertion read elapsed time? Adding a budget to a duration-sensitive test would
change its meaning.
The scan carries a firing control:
sql-driver-connect-bound.test.tsholds exactly thenamed hazard,
elapsedbounded above 8_000 and below 20_000, and the scan finds it.live-dialect-matrix.isolation.test.tsindex introspectionlive-dialect-matrix.isolation.test.tsschema introspectionintrospectSchema()sql-driver-autonumber-cold-race.test.tsokflags, SQLSTATE23505, a row valuesql-driver-json-binding-without-ddl.test.ts§3backend-fault-envelopedeclareSweephookbackend-fault-envelopepg-only hookNo site's meaning changes. Zero of the six carry a duration-dependent assertion; the three
numeric comparisons anywhere in these files are a test-file count, an identifier-length
limit, and an index count.
Per ruling ④: these six were found structurally, by an AST walk. ⛔ None is known to
time out. The only measured instance of the defect shape remains #13688.
What was deliberately left alone
Classification is by reading each
new SqlDriver(...)argument, never the filename ordirectory. A per-site AST walk over all 159 test files in the package finds 193
driver-constructing sites:
it()/test()sites left on the fast 5000ms default.These use
dialectCell('sqlite').config()or abetter-sqlite3in-memory literal and arecorrectly fast. A blanket change would have silently loosened every one of them — the exact
failure ruling ② exists to prevent. (The card's count for this population is 42; my walk
counts 39 by a per-site denominator, counting
it()blocks that construct a driver directlyin their own body. I did not re-derive the card's number — the discrepancy is a denominator
difference, not a disagreement about which sites are embedded.)
it()sites in the whole package, and they arePopulation A. Independent confirmation that the card's population is complete and exact.
Verification
All at
193b345f, the final commit.pnpm --filter '@objectstack/driver-sql^...' build— VERDICT command-exit 0.live-cell sites;
OS_TEST_POSTGRES_URLandOS_TEST_MYSQL_URLare both unset in thiscontainer, so the six sites themselves are a legitimate NOT MEASURED — no green is
claimed for them.
pnpm --filter @objectstack/driver-sql typecheck— exit 0, andtsc --listFilesconfirmsall four edited files are in the program (1 occurrence each), so that green really covers
the edits.
scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commands, re-derived at the final commit and unchanged:26 commands — 23 pass, 3 NOT MEASURED. The three print
PREREQUISITE NOT METin theirown verdict text and exit 3, the code reserved for it, distinct from a finding's 1:
check-test-completeness(needs a savedturbo run testlog),check:dual-build-cjs-loadsand
check:type-check-debt(both need a full-repopnpm build). Not reds, and CI runsthem on this PR.
Changeset
This PR carries the
skip-changesetlabel rather than a changeset, which departs from thedispatch instruction. The reason is mechanical: the diff is four
*.test.tsfiles andreleases nothing from any package. An empty-frontmatter changeset is rejected outright by
scripts/check-empty-changeset.mjs, and a non-empty one would bump@objectstack/driver-sqland write a CHANGELOG entry for a change no user can observe. Flagged for the PM rather than
decided silently.
Out of scope
The same AST walk found 7 unbudgeted hooks whose driver argument is unconditionally live,
in four files, none of them named by #14100 — plus the
hookTimeoutcorrection above, whichreframes the whole defect class. Filed separately rather than folded in, following this
card's own "separate card rather than a rider" precedent; #14100 is not the place for them.
Generated by Claude Code