fix(test): isolate Gateway database credential selection

Reset the simulated process selection before each credential case, matching the sibling engine suite. A preceding real SQLite Gateway boot otherwise makes the first case fail in the non-isolated worker. Preserve teardown and the within-case replacement rejection assertions.

Reproduced the first-case conflict on the frozen base under Node and pinned Bun. The ordered real-Gateway sequence and engine/context sibling suites now pass all 18 cases per runtime; targeted formatting, lint and whitespace checks pass. Production and schema changes: none.
This commit is contained in:
Vincent Koc 2026-11-15 16:49:40 +08:00
parent b135516219
commit 5d5ca9d2ba
No known key found for this signature in database

View file

@ -1,4 +1,4 @@
import { afterEach, describe, expect, it } from "vitest";
import { afterEach, beforeEach, describe, expect, it } from "vitest";
import {
sanitizeEnvVars,
sanitizeExplicitSandboxEnvVars,
@ -20,6 +20,8 @@ const config = (key: string) => ({
},
});
beforeEach(resetDatabaseEngineSelectionForTest);
afterEach(async () => {
await closePostgresPool();
resetDatabaseEngineSelectionForTest();