From 491bf0ec86a02bd9dcd4ca6801badba838fe0a07 Mon Sep 17 00:00:00 2001 From: os-musk Date: Thu, 3 Sep 2026 11:30:47 +0000 Subject: [PATCH] test(driver-sql): budget the 8th live-cell hook, reached through `rawDriver()` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Claude-Session: https://claude.ai/code/session_0112hMx9hjJ9BgB28X97DS68 --- .../sql-driver-datetime-mysql-storage.test.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/drivers/driver-sql/src/sql-driver-datetime-mysql-storage.test.ts b/packages/drivers/driver-sql/src/sql-driver-datetime-mysql-storage.test.ts index 62aaea1be4..fdb30016a7 100644 --- a/packages/drivers/driver-sql/src/sql-driver-datetime-mysql-storage.test.ts +++ b/packages/drivers/driver-sql/src/sql-driver-datetime-mysql-storage.test.ts @@ -54,12 +54,28 @@ describe.skipIf(!URL)('Field.datetime on MySQL (#3942)', () => { let driver: SqlDriver; let serverTimeZone = ''; + // ── Why this beforeAll carries an explicit 60_000 budget (#14628) ── + // The live cell is one indirection away: this hook builds no driver of its + // own, it calls `rawDriver()` above — which hard-codes `MYSQL_CELL.config()`, + // unconditionally LIVE, not a parametrised `cell.config()` that would be + // SQLite for the sqlite cell. So the probe pays a real live connect, a + // `select @@global.time_zone` round trip and a disconnect against the cell's + // MySQL server. That one level of indirection is the whole reason the #14213 + // walk — which read each hook's OWN `new SqlDriver(...)` argument — did not + // reach this site while it did reach the three beforeEach hooks below. + // ⚠️ A hook inherits `hookTimeout`, NOT `testTimeout`. Measured in this + // package's config (which sets neither, so both are vitest's own defaults): + // an unbudgeted hook dies at 10000ms ("Hook timed out in 10000ms"), not at + // the 5000ms an unbudgeted it() gets. + // A beforeAll is the LIGHTEST shape in this class — the cost is paid once + // per suite, not once per test — and ⛔ this is NOT a claim that the hook is + // known to time out: it was found by an AST walk, never by a measured red. beforeAll(async () => { const probe = rawDriver(); const rows = await rowsOf(probe, `select @@global.time_zone as tz`); serverTimeZone = String((rows[0] as any).tz); await probe.disconnect(); - }); + }, 60_000); // ── Why this beforeEach carries an explicit 60_000 budget (#14213) ── // The driver argument here is `MYSQL_CELL.config()` — unconditionally LIVE,