From 62dc3a5014817621f823b7b3de6381aa83e11fa6 Mon Sep 17 00:00:00 2001 From: Fabian Csy Date: Fri, 9 Oct 2026 07:45:09 +0000 Subject: [PATCH] test(core): assert migrateAll only on the schemas the test owns The test database is shared by every package's tests, and turbo runs them in parallel: opencode's tests create and drop throwaway schemas while this test's migrateAll scans every schema holding opencode's tables. One dropped mid-scan lands in `failed` ("SELECT id FROM migration"), which failed the documentor-pg push run after the tool-delta-reads merge. Reproduced locally by looping this test beside test/session/: 8 failures in 275 runs before, 0 in 247 after. Co-Authored-By: Claude Opus 5.5 (1M context) --- packages/core/test/pg/migration.test.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/core/test/pg/migration.test.ts b/packages/core/test/pg/migration.test.ts index 99b5d647fc51..efaaa21797c1 100644 --- a/packages/core/test/pg/migration.test.ts +++ b/packages/core/test/pg/migration.test.ts @@ -185,7 +185,10 @@ describe("migration lifecycle", () => { expect(done).toContain(first) expect(done).toContain(second) expect(done).not.toContain(empty) - expect(failed).toEqual([]) + // The test database is shared with every package's tests, whose + // throwaway schemas are created and dropped while this scan runs; one + // dropped mid-scan fails there, so only this test's schemas are asserted. + expect(failed.filter((entry) => [first, second, empty].includes(entry.schema))).toEqual([]) for (const name of [first, second]) expect(yield* db.all(sql.raw(`select id from "${name}".marker`))).toEqual([]) expect(yield* db.all(sql`select 1 from information_schema.tables where table_schema = ${empty}`)).toEqual([])