Skip to content

Commit dc5d413

Browse files
committed
test(gateway): isolate reload handler plugin records
The reload handler no-op config test enables fake timers and drains all timers. In cross-file non-isolated runs, server-startup-post-attach closes the shared state DB first, so this test reopens it through the managed config reloader's default installed-plugin record read. That DB open schedules SQLite WAL maintenance at src/infra/sqlite-wal.ts:345 while fake timers are active, and vi.runAllTimersAsync spins the interval until Vitest aborts after 10000 timers. Mock installed plugin record reads in this handler test so the test owns only the reload debounce timer it is trying to drain.
1 parent ad5b81e commit dc5d413

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/gateway/server-reload-handlers.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,11 @@ vi.mock("../agents/agent-bundle-mcp-tools.js", () => ({
159159
disposeAllSessionMcpRuntimes: hoisted.disposeAllSessionMcpRuntimes,
160160
}));
161161

162+
vi.mock("../plugins/installed-plugin-index-records.js", () => ({
163+
loadInstalledPluginIndexInstallRecords: vi.fn(async () => ({})),
164+
loadInstalledPluginIndexInstallRecordsSync: vi.fn(() => ({})),
165+
}));
166+
162167
vi.mock("./server-cron.js", async () => {
163168
const actual = await vi.importActual<typeof import("./server-cron.js")>("./server-cron.js");
164169
return {

0 commit comments

Comments
 (0)