diff --git a/config/vitest.config.ts b/config/vitest.config.ts index 273f899ecb7..6202566aa32 100644 --- a/config/vitest.config.ts +++ b/config/vitest.config.ts @@ -142,6 +142,9 @@ export default defineConfig({ } : {}), projects, + // A finished file's background log can lose the race with worker teardown; only that log line is lost. + onUnhandledError: (error) => + !(error.name === 'EnvironmentTeardownError' && error.message.includes('"onUserConsoleLog"')), ...(process.platform === 'win32' ? { maxWorkers: 4 } : {}) } }) diff --git a/src/main/codex-accounts/runtime-home-wsl-managed-accounts.test.ts b/src/main/codex-accounts/runtime-home-wsl-managed-accounts.test.ts index 0521401c3af..9acecc09d91 100644 --- a/src/main/codex-accounts/runtime-home-wsl-managed-accounts.test.ts +++ b/src/main/codex-accounts/runtime-home-wsl-managed-accounts.test.ts @@ -1,6 +1,8 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs' import { join } from 'node:path' +import type * as LegacyWslRuntimeAuthDrain from './legacy-wsl-runtime-auth-drain' +import type * as WslCodexSessionBridge from '../codex/history/bridges/wsl-codex-session-bridge' import { createSettings } from './runtime-home-settings-test-fixtures' import { createCodexAuthJson, @@ -16,6 +18,15 @@ import { vi.mock('../wsl/discovery/wsl-background-exec-gate', () => ({ blockedWslDistroForExec: async () => null })) +// Background WSL drain/bridge spawn wsl.exe and warn after the file ends; these specs cover only routing. +vi.mock('./legacy-wsl-runtime-auth-drain', async (importOriginal) => ({ + ...(await importOriginal()), + startLegacyWslRuntimeAuthDrain: async () => {} +})) +vi.mock('../codex/history/bridges/wsl-codex-session-bridge', async (importOriginal) => ({ + ...(await importOriginal()), + startWslCodexSessionBridgeInBackground: async () => {} +})) vi.mock('electron', () => ({ app: { getPath: () => testState.userDataDir diff --git a/src/main/runtime/orca-runtime-test-mocks/setup.spec.ts b/src/main/runtime/orca-runtime-test-mocks/setup.spec.ts index db82a299fd4..37a8b5e845e 100644 --- a/src/main/runtime/orca-runtime-test-mocks/setup.spec.ts +++ b/src/main/runtime/orca-runtime-test-mocks/setup.spec.ts @@ -294,6 +294,12 @@ vi.mock('../../git/worktrees/catalog/worktree-listing', async (importOriginal) = describeCreatedWorktree: (await getWorktreeOwnerMocks()).describeCreatedWorktree })) +// Fire-and-forget reclaim runs real Git on fixture paths and warns after the file ends. +vi.mock( + '../../workspaces/creation/preparation/worktree-create-preparation-project-removal', + () => ({ releaseWorktreeCreatePreparationsForRepo: vi.fn() }) +) + const { getWorktreeOwnerMocks } = vi.hoisted(() => { function createWorktreeOwnerMocks() { return (() => ({