Skip to content

driver-sql: 37 more live-DDL it() blocks across 9 files inherit vitest's 5000ms default (same shape as #13688) #13902

Description

@zhuangjianguo

Filed while implementing #13688 (its A2.2 instruction: sweep the package for other
live-DDL tests still on vitest's inherited 5000ms default, widen the fix only within
the one target file, file a finding for the rest). Unassigned: recording only.

What #13688 fixed

Two it(...) blocks in sql-driver-13056-orphan-shadow-column-cleanup.test.ts drove
2-3 full new SqlDriver(...) -> initObjects(...) -> disconnect() cycles against
live MySQL with no explicit timeout, so they inherited vitest's 5000ms default. That
budget was never chosen — four sibling files in the same package already carry
explicit per-test budgets (60_000 / 120_000 / 40_000). The timeout (not an
assertion failure, no MySQL error in the logs) reddened unrelated PRs, e.g. #13685
(a plugin-auth-only diff) and ejected #13687/#13761 from the merge queue (#13767).

The sweep

A script walked every it(...) nested inside a declareDialectCell(...) callback
in packages/drivers/driver-sql/src/*.test.ts and checked whether the third argument
is an explicit numeric timeout. Same defect shape, still on the default, in 9 more
files, 37 more it(...) blocks
:

File Cells it() blocks w/o budget
sql-driver-11627-hash-shadow-key.test.ts MySQL, PG 9
sql-driver-11565-row-byte-budget.test.ts MySQL 6
sql-driver-keyed-text-mysql.test.ts MySQL 5
sql-driver-12998-shadow-null-safe-key.test.ts MySQL 4
sql-driver-13015-shadow-carried-index-drift.test.ts MySQL 4
sql-driver-11794-richtext-text-family.test.ts MySQL, PG 3
sql-driver-string-maxlength-varchar.test.ts MySQL, PG 3
sql-driver-backend-fault-envelope.test.ts PG 2
sql-driver-11389-date-tz-skew.test.ts MySQL, PG 1

Most of these (all but sql-driver-backend-fault-envelope.test.ts) follow the exact
#13688 shape: each it(...) itself constructs a fresh new SqlDriver(...), calls
initObjects(...) (schema-sync DDL), and reads information_schema back — one or
more full connect cycles per test, inline in the it() body. Spot-checked
sql-driver-11627-hash-shadow-key.test.ts:135 as representative; the pattern repeats
across the other 7.

sql-driver-backend-fault-envelope.test.ts's two it() blocks are lower-risk: they
reuse a single driver connected once in a beforeAll and each issue 1-2 queries
against an already-open connection, not a fresh connect/DDL/disconnect cycle. Listed
for completeness since they are still on the inherited default, but the cost profile
is not the same as the other 8 files.

What this is and is not

This is a structural sweep (does an explicit budget exist), not a confirmed list
of CI failures — I have not run these against live MySQL/PG here (no live containers
in this environment; see #13688's own A2.1 for the same constraint). The evidence
that the shape is a real defect, not merely a theoretical one, is #13688 itself:
timeout-not-assertion, no DB error, and the repo's own convention (4 sibling files
budgeted) treating "no timeout" as an oversight rather than a choice.

Recommendation

Per #13688's dispatch order (STOP condition 3): "A2.2 finds the same shape across
many files in the package -> report before sweeping; a package-wide re-budget is a
different, larger decision" -- so #13688 fixed only its own two tests and this issue
records the rest for a deliberate decision, not a silent drive-by. The repo's existing
convention is a per-test budget (never a package-wide testTimeout, which would
silently re-budget the 150+ tests that legitimately want the fast default) -- same
shape as #13688's fix, applied file by file.

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions