Skip to content

[finding] the two metadata-protocol live-MySQL suites still share one conformance database — the per-file isolation #9350 landed stops at the driver-sql package #10382

Description

@os-elon

Found while implementing #9350 (PR #10381). Filed unassigned; not fixed there, because it is a different package from the one that card's claim scoped.

What #9350 changed, and where it stops

#9350 gave every live-dialect test file in packages/drivers/driver-sql its own schema (Postgres) / database (MySQL), derived from vitest's own testPath through live-dialect-matrix.testkit.ts. Two live files sit outside that package and were left as they were:

  • packages/metadata-protocol/src/migrations/seed-tenancy-backfill.live-mysql.test.ts
  • packages/metadata-protocol/src/migrations/sys-setting-identity-index.live-mysql.test.ts

Both read process.env.OS_TEST_MYSQL_URL directly and connect with mysql2/promise (raw mysql.createConnection, not knex), so both land in the conformance database the CI job provisions — the same one, as each other and as anything else pointed at that URL:

.github/workflows/ci.yml
OS_TEST_MYSQL_URL: mysql://root:root@127.0.0.1:3306/conformance

They run in their own CI step ("Run the metadata-protocol migration statements against live MySQL"), separate from the driver-sql leg, so they cannot collide with driver-sql files — but they can collide with each other, and the property #9350 established ("a live file's schema derives from the file, not from a shared constant") is not true repo-wide while they exist.

Why it was not fixed in that PR

Three reasons, in order of weight:

  1. The dispatch claim's file surface was live-dialect-matrix.testkit.ts plus the driver-sql test files it required. packages/metadata-protocol is a different package and a different gate family.
  2. These two use raw mysql2/promise, not knex, so they cannot reuse the pool.afterCreate hook the driver-sql fix is built on — they need an explicit create database if not exists + use at connect time. That is a different edit, not the same mechanical one.
  3. A live MySQL cannot be run in an agent container (measured on 2026-08-20: docker daemon unreachable, no mysqld, no client, nothing on 3306). The driver-sql half was verifiable because Postgres 16 binaries happened to be present locally; this half has no equivalent, so the change would be unverifiable except through CI.

Suggested shape

Export the resolver (liveSchemaNameFor / currentLiveSchema) from a place both packages can reach, or give metadata-protocol its own small equivalent, then have each file issue create database if not exists + use on the connections it opens. The acceptance criterion should be the same structural one #9350 used, and for the same reason: the flake it came from has been dormant, so a green run proves nothing — assert that the two files resolve distinct names and that the name derives from the file.

Note that #9350's enforcement (the source scan in packages/drivers/driver-sql/src/live-dialect-matrix.isolation.test.ts) covers only its own package, so nothing currently goes red for these two. Closing this out means the scan grows a repo-wide sibling, or metadata-protocol grows its own.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions