Skip to content

Commit c4771e8

Browse files
committed
test(driver-sql): re-measure the live-cell budget against live PG AND live MySQL, and cite the convention's own stated limit
The earlier table was taken with only a Postgres URL set, so it never touched the cell that actually timed out. Re-measured in one run against live Postgres 16.13 and live MySQL 8.0.46: live-mysql §2 costs 64 ms idle and 121 ms with the loop held, against the >5000 ms the queue build spent in that same body. Also records what the numbers do not license: this file is one of the heavier ones (12998's live cells peak at 248 ms), and #13902's own comment says it sized 60_000 by sibling convention and NOT as a claim that these tests run near it — which is precisely the half this constant adds a derived corridor to. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ADLdAs2pVcH17h9tZKWMBg
1 parent 994f667 commit c4771e8

1 file changed

Lines changed: 35 additions & 17 deletions

File tree

packages/drivers/driver-sql/src/live-dialect-matrix.testkit.ts

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -390,25 +390,35 @@ export function declareUnprovisionedCell(cell: DialectCell, matrix: string): voi
390390
*
391391
* This package sets no `testTimeout`, so every cell inherited vitest's default
392392
* 5000 ms — the SQLite cell, which does no I/O, and the live cells, which talk
393-
* to a separate server over a socket. Measured on this container against a live
394-
* Postgres 16.13, `sql-driver-11224-update-stamp-precision.test.ts` §2 (six
393+
* to a separate server over a socket. Measured against a live Postgres 16.13
394+
* and a live MySQL 8.0.46 in ONE run, on the cell that actually timed out:
395+
* `sql-driver-11224-update-stamp-precision.test.ts` §2 on live mysql (six
395396
* rounds of create → read → update → a server-side cursor comparison, so 24
396397
* live round-trips in one test body):
397398
*
398399
* ```
399-
* idle loop loop held by a re-scheduling 12 ms hog (8 on 4 CPUs)
400-
* sqlite §2 8 ms 25 ms
401-
* live pg §2 31 ms 64 ms
400+
* §2 idle loop loop held by a re-scheduling 12 ms hog (8 on 4 CPUs)
401+
* sqlite 21 ms 24 ms
402+
* live postgres 50 ms 50 ms
403+
* live mysql 64 ms 121 ms
402404
* ```
403405
*
404-
* ⚠️ Read what that does NOT license. The observed cost does not derive this
405-
* number and cannot: the queue build that dequeued PR #16430 spent MORE than
406-
* 5000 ms in that same test body, which is over 75x the loaded figure above.
407-
* A budget written as "measured cost times a margin" would have landed in the
408-
* hundreds of milliseconds and been wrong by two orders of magnitude. What the
409-
* measurement establishes is the opposite — that the cost of the WORK is not
410-
* what sets this bound — so the bound is derived from what it has to sit
411-
* between instead.
406+
* ⚠️ Read what that does NOT license, in three directions.
407+
*
408+
* - It does not derive this number, and cannot. The queue build that dequeued
409+
* PR #16430 spent MORE than 5000 ms in that same live-mysql body — 40x to
410+
* 75x the figures above. A budget written as "measured cost times a margin"
411+
* would have landed in the low hundreds of milliseconds and been wrong by
412+
* two orders of magnitude. What the measurement establishes is the opposite:
413+
* the cost of the WORK is not what sets this bound, so the bound is derived
414+
* from what it has to sit BETWEEN instead.
415+
* - It is not the cost of live cells in general. This file is one of the
416+
* heavier ones; `sql-driver-12998-shadow-null-safe-key.test.ts`'s live cells
417+
* were measured on this same container at 248 ms for the slowest of them.
418+
* ⛔ Nothing here claims any live cell is normally near this ceiling.
419+
* - The numbers above are ONE world. Earlier readings taken on this container
420+
* with only `OS_TEST_POSTGRES_URL` set are not comparable with them: the box
421+
* and the cell population both differ. Whole-row comparisons only.
412422
*
413423
* ## The two bounds it sits between, both read off the code it guards
414424
*
@@ -440,7 +450,15 @@ export function declareUnprovisionedCell(cell: DialectCell, matrix: string): voi
440450
* sites: 60 explicit `60_000` budgets across 22 files — #13688 and its sweep
441451
* #13902 put them on live test BODIES, #14213 and #14628 on the hooks that pay
442452
* a live connect. Adopting it leaves the live matrix with ONE live budget
443-
* instead of two, so a red at 60_000 ms is unambiguous about which bound it hit. ⛔ It is NOT `driver-mongodb`'s 30_000 carried over
453+
* instead of two, so a red at 60_000 ms is unambiguous about which bound it hit.
454+
*
455+
* ⭐ That convention states its own reasoning, and states its own limit —
456+
* `sql-driver-12998-shadow-null-safe-key.test.ts`, on the four budgets #13902
457+
* gave it: "Sized like this package's siblings — 60_000 is 7 of its 9 explicit
458+
* budgets — and NOT an assertion that these tests are normally anywhere near
459+
* that slow." So the precedent picked the value by convention and said so; what
460+
* it never had is a CORRIDOR the value must lie in. That is what this constant
461+
* adds, and it is the half that is derived. ⛔ It is NOT `driver-mongodb`'s 30_000 carried over
444462
* by analogy — that is that package's number, and this one is this package's.
445463
*
446464
* It clears the derived floor by 4x — arithmetically, room for four
@@ -502,9 +520,9 @@ export function declareDialectCell(
502520
//
503521
// ⛔ Deliberately NOT a package-wide `testTimeout` in `vitest.config.ts`.
504522
// That is the one knob with no cell-level discrimination, so it would raise
505-
// the ceiling for the SQLite cell too — measured at 8 ms idle / 25 ms hogged
506-
// for the same test body — and this package's fast in-memory cells are where
507-
// a 5 s guard is doing real work.
523+
// the ceiling for the SQLite cell too — measured at 21 ms idle / 24 ms hogged
524+
// for the same test body the live-mysql cell spends 64-121 ms on — and this
525+
// package's fast in-memory cells are where a 5 s guard is doing real work.
508526
//
509527
// A suite-level `timeout` cascades to the tests the consumer's own describes
510528
// declare, and an explicit per-`it` third argument still wins over it — both

0 commit comments

Comments
 (0)