mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-09 05:43:57 +00:00
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.
This commit is contained in:
@@ -159,6 +159,11 @@ vi.mock("../agents/agent-bundle-mcp-tools.js", () => ({
|
||||
disposeAllSessionMcpRuntimes: hoisted.disposeAllSessionMcpRuntimes,
|
||||
}));
|
||||
|
||||
vi.mock("../plugins/installed-plugin-index-records.js", () => ({
|
||||
loadInstalledPluginIndexInstallRecords: vi.fn(async () => ({})),
|
||||
loadInstalledPluginIndexInstallRecordsSync: vi.fn(() => ({})),
|
||||
}));
|
||||
|
||||
vi.mock("./server-cron.js", async () => {
|
||||
const actual = await vi.importActual<typeof import("./server-cron.js")>("./server-cron.js");
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user