diff --git a/tests/ipcMain/sendMessage.errors.test.ts b/tests/ipcMain/sendMessage.errors.test.ts index 2893b11172..724151e033 100644 --- a/tests/ipcMain/sendMessage.errors.test.ts +++ b/tests/ipcMain/sendMessage.errors.test.ts @@ -15,6 +15,7 @@ import { configureTestRetries, } from "./helpers"; import { createSharedRepo, cleanupSharedRepo, withSharedWorkspace } from "./sendMessageTestHelpers"; +import { preloadTestModules } from "./setup"; import type { StreamDeltaEvent } from "../../src/common/types/stream"; import { IPC_CHANNELS } from "../../src/common/constants/ipc-constants"; @@ -40,9 +41,13 @@ const PROVIDER_CONFIGS: Array<[string, string]> = [ // - Longer running tests (tool calls, multiple edits) can take up to 30s // - Test timeout values (in describe/test) should be 2-3x the expected duration -beforeAll(createSharedRepo); -afterAll(cleanupSharedRepo); describeIntegration("IpcMain sendMessage integration tests", () => { + beforeAll(async () => { + await preloadTestModules(); + await createSharedRepo(); + }); + afterAll(cleanupSharedRepo); + configureTestRetries(3); // Run tests for each provider concurrently diff --git a/tests/ipcMain/streamErrorRecovery.test.ts b/tests/ipcMain/streamErrorRecovery.test.ts index 011ba629be..b41e7366d7 100644 --- a/tests/ipcMain/streamErrorRecovery.test.ts +++ b/tests/ipcMain/streamErrorRecovery.test.ts @@ -16,7 +16,12 @@ * test the recovery path without relying on actual network failures. */ -import { setupWorkspace, shouldRunIntegrationTests, validateApiKeys } from "./setup"; +import { + setupWorkspace, + shouldRunIntegrationTests, + validateApiKeys, + preloadTestModules, +} from "./setup"; import { sendMessageWithModel, createEventCollector, @@ -220,6 +225,8 @@ async function collectStreamUntil( } describeIntegration("Stream Error Recovery (No Amnesia)", () => { + beforeAll(preloadTestModules); + test.concurrent( "should preserve exact prefix and continue from exact point after stream error", async () => {