test(driver-sql): budget the 8th live-cell hook, reached through the rawDriver() helper - #14950
Merged
Merged
Conversation
…Driver()` The `beforeAll` of the `Field.datetime on MySQL (#3942)` suite builds no driver in its own body — it calls the module-level `rawDriver()` helper, which hard-codes `MYSQL_CELL.config()`. That one level of indirection is why the #14213 walk, which read each hook's own `new SqlDriver(...)` argument, reached the three `beforeEach` hooks in this file and not this one. Give it the same explicit `60_000` third argument the seven sites of PR #14629 landed with, plus a note recording why the narrow walk missed it and that a hook inherits `hookTimeout` (measured 10000ms in this package's config, which sets neither timeout), not `testTimeout` (5000ms). Re-running the walk with one level of helper indirection resolved: at `13b520069^` it reports 5 inline-only + 2 inline+helper + 1 indirect-only = 8; at HEAD with this change, 8 budgeted and 0 unbudgeted. No ninth site. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0112hMx9hjJ9BgB28X97DS68
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-musk
marked this pull request as ready for review
September 3, 2026 16:21
os-musk
enabled auto-merge
September 3, 2026 16:21
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.
Fixes #14628
The
beforeAllof theField.datetime on MySQL (#3942)suite inpackages/drivers/driver-sql/src/sql-driver-datetime-mysql-storage.test.tsisthe 8th unbudgeted live-cell hook in this package, and the one PR #14629
deliberately left. It gets the same explicit
60_000third argument the sevenlanded with, plus a note recording why the narrow walk missed it.
Test-only: one comment block and one timeout argument.
skip-changeset— thisPR publishes nothing from any package.
Why the #14213 walk did not reach it
That walk read each hook's own
new SqlDriver(...)argument and matched anamed live-cell constant. This hook constructs no driver in its body at all: it
calls the module-level helper
rawDriver()at:51, which hard-codesMYSQL_CELL.config(). One level of helper indirection hides the liveness froman argument reading. The same file's three
beforeEachhooks callrawDriver()too, but they also construct a driver inline, which is why the narrow walk
caught them and not this one.
Measured evidence
A — the site is still unbudgeted at
origin/main. Base commit110b85839,which contains PR #14629 as
13b520069(git merge-base --is-ancestorsaysyes). Before this change:
sql-driver-datetime-mysql-storage.test.ts:51—const rawDriver = () => new SqlDriver(MYSQL_CELL.config());sql-driver-datetime-mysql-storage.test.ts:57—beforeAll(async () => {…:62});, no third argumentB —
rawDriver()reaches an unconditionally live cell, not a parametrisedone. Following the helper:
MYSQL_CELLisdialectCell('mysql')(
live-dialect-matrix.testkit.ts:349), which resolves to theDIALECT_CELLSentry at
:308-:323carryingid: 'mysql',live: true, and aconfig()returning a real
mysql2connection URL. It is a fixed cell, never amatrix-iterated
cell.config()that would be SQLite for the sqlite cell — sothis is the same easy shape as the seven, not the
declareDialectCell(...)population #14213 ruled out as a judgement call.
C — the walk, re-run with one level of helper indirection resolved. An AST
walk over all 161 test files in the package, classifying each unbudgeted
beforeAll/beforeEach/afterAll/afterEachthat reaches a live cell eitherinline or through a module-level helper:
13b520069^(pre-#14629 control)110b85839(base, post-#14629)The control reproduces the filing's table exactly: the narrow population is
5 + 2 = the seven #14629 budgeted, and the indirect set is 2 + 1 = 3, of which
exactly 1 was not already among the seven. No ninth site. With this change
the population is closed at 8.
D — no prose states the 5000ms figure for a hook. Three mentions of
5000msexist in this file (:74,:177,:262before the edit), and allthree are the correct contrastive framing — each pairs "a hook inherits
hookTimeout(measured 10000ms)" against "nottestTimeout(5000ms)". Noneattributes 5000ms to a hook. As #14629 expected, there was nothing to correct.
The note added here says 10000ms for the hook and names 5000ms only as the
figure an unbudgeted
it()gets.packages/drivers/driver-sql/vitest.config.tssets neitherhookTimeoutnortestTimeout— confirmed by reading the whole file — so both are vitest's owndefaults and the 10000ms figure holds by absence.
Verification
All at
491bf0ec8, the final commit.pnpm --filter '@objectstack/driver-sql^...' build— dependency closure built first; VERDICT command-exit 0.pnpm --filter @objectstack/driver-sql exec tsc --noEmit --listFiles— exit 0, noerror TS. The edited file is present in the tsc program (checked with--listFiles, against a control term), so the green covers the edit rather than skipping it.pnpm --filter @objectstack/driver-sql exec vitest run --maxWorkers=2— Test Files 152 passed, 9 skipped (161); Tests 2294 passed, 140 skipped (2434).OS_TEST_MYSQL_URLthedescribe.skipIf(!URL)suites do not run, so the budgeted hook executes only in the live-dialect matrix — the severity qualifier from triage, confirmed rather than assumed.node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commands(no path arguments; it derives the change set from git off the merge base): 33 commands, 30 pass, 0 red.pnpm check:pm-dispatch-gatespasses.node scripts/pm/check-governed-merges.mjs --teston the final one-file list: NOT governed, ordinary queue landing.check-test-completeness.mjs("That list names this script with NO argument … the local reading for this gate is NOT MEASURED. It is not a red"), andcheck:dual-build-cjs-loadspluscheck:type-check-debt, both "PREREQUISITE NOT MET" needing a full workspace build CI performs before them. Declared, not silently dropped: neither can be moved by this diff — nothing here reaches a publisheddist/, and driver-sql's owntsc --noEmitis clean.🤖 Generated with Claude Code
Generated by Claude Code
Generated by Claude Code