diff --git a/packages/platform-apple/src/readiness/runtime.test.ts b/packages/platform-apple/src/readiness/runtime.test.ts index 44b87cab42..162d0ae3f4 100644 --- a/packages/platform-apple/src/readiness/runtime.test.ts +++ b/packages/platform-apple/src/readiness/runtime.test.ts @@ -196,11 +196,17 @@ test('a boot confirmed only after the deadline is a boot_timeout, and the confir }); test('without a startup deadline the boot wait keeps its default budget', async () => { - const { host, calls } = coldSimulatorHost({}); + vi.useFakeTimers(); + try { + vi.setSystemTime(1_000_000); + const { host, calls } = coldSimulatorHost({}); - await ensureAppleReady(host, simulator(), new AbortController().signal); + await ensureAppleReady(host, simulator(), new AbortController().signal); - expect(calls.find((call) => call.args.includes('bootstatus'))?.timeoutMs).toBe(120_000); + expect(calls.find((call) => call.args.includes('bootstatus'))?.timeoutMs).toBe(120_000); + } finally { + vi.useRealTimers(); + } }); test('physical readiness forwards the request signal to the focused host port', async () => { diff --git a/scripts/check-affected/checks.ts b/scripts/check-affected/checks.ts index a68e03a8f3..9e681cae39 100644 --- a/scripts/check-affected/checks.ts +++ b/scripts/check-affected/checks.ts @@ -10,7 +10,6 @@ // agent reads before skipping a check locally cannot go stale. import { ALL_CHECKS, type CheckId } from './model.ts'; -import { DEFAULT_VITEST_MAX_WORKERS } from '../lib/vitest-concurrency.ts'; export type CheckKind = | { readonly type: 'script'; readonly script: string } @@ -183,16 +182,7 @@ export function resolveCommand( changedFiles: readonly string[] = [], ): string[] { if (spec.kind.type === 'vitest-related') { - return [ - 'pnpm', - 'exec', - 'vitest', - 'related', - '--run', - '--passWithNoTests', - `--maxWorkers=${DEFAULT_VITEST_MAX_WORKERS}`, - ...changedFiles, - ]; + return ['pnpm', 'exec', 'vitest', 'related', '--run', '--passWithNoTests', ...changedFiles]; } const { script } = spec.kind; if (!(script in scripts)) { diff --git a/scripts/check-affected/model.test.ts b/scripts/check-affected/model.test.ts index 9ab6d81f36..4fd46c2c12 100644 --- a/scripts/check-affected/model.test.ts +++ b/scripts/check-affected/model.test.ts @@ -4,7 +4,6 @@ import path from 'node:path'; import { test } from 'node:test'; import { fileURLToPath } from 'node:url'; import { assertCatalogComplete, CHECK_CATALOG, resolveCommand } from './checks.ts'; -import { DEFAULT_VITEST_MAX_WORKERS } from '../lib/vitest-concurrency.ts'; import { ALL_CHECKS, selectChecks, type CheckId, type SelectInput } from './model.ts'; function plan(changedFiles: string[], extra: Partial = {}) { @@ -347,10 +346,16 @@ test('vitest-related delegates changed paths to Vitest instead of modeling proje 'related', '--run', '--passWithNoTests', - `--maxWorkers=${DEFAULT_VITEST_MAX_WORKERS}`, 'src/a.ts', 'test/fixture.ts', ]); + assert.equal( + resolveCommand(related, {}, 'origin/main', ['src/a.ts']).some((arg) => + arg.startsWith('--maxWorkers='), + ), + false, + 'worker sizing belongs to vitest.config.ts', + ); }); // Guards the catalog against reality, not fixtures: the self-test above uses a diff --git a/scripts/check-affected/run.test.ts b/scripts/check-affected/run.test.ts index 52de0069f0..97863e798a 100644 --- a/scripts/check-affected/run.test.ts +++ b/scripts/check-affected/run.test.ts @@ -11,7 +11,6 @@ import { test } from 'node:test'; import { runCmdSync } from '@agent-device/host-kit/command'; import { STALE_NODE_MODULES_MESSAGE } from './lockfile-install-sync.ts'; import { CHECK_CATALOG } from './checks.ts'; -import { DEFAULT_VITEST_MAX_WORKERS } from '../lib/vitest-concurrency.ts'; import { selectChecks } from './model.ts'; import { type CommandExecutor, readChangedFiles, runChecks } from './run.ts'; @@ -161,16 +160,7 @@ test('runChecks passes the selector change set to Vitest related', async () => { assert.equal(code, 0); assert.deepEqual( executed.find((command) => command.includes('related')), - [ - 'pnpm', - 'exec', - 'vitest', - 'related', - '--run', - '--passWithNoTests', - `--maxWorkers=${DEFAULT_VITEST_MAX_WORKERS}`, - ...changedFiles, - ], + ['pnpm', 'exec', 'vitest', 'related', '--run', '--passWithNoTests', ...changedFiles], ); }); @@ -205,7 +195,7 @@ test('runChecks skips GitHub-authoritative checks and passes when locals succeed } }); -test('runChecks leaves coverage to CI and runs capped related tests once', async () => { +test('runChecks leaves coverage to CI and runs related tests once through Vitest config', async () => { const executed: string[][] = []; const execute: CommandExecutor = async (command) => { executed.push(command); @@ -222,7 +212,11 @@ test('runChecks leaves coverage to CI and runs capped related tests once', async !related[0]?.includes('--coverage'), 'coverage instrumentation stays GitHub-authoritative; the local run must not add it', ); - assert.ok(related[0]?.includes(`--maxWorkers=${DEFAULT_VITEST_MAX_WORKERS}`)); + assert.equal( + related[0]?.some((arg) => arg.startsWith('--maxWorkers=')), + false, + 'worker sizing belongs to vitest.config.ts', + ); assert.ok( executed.findIndex((command) => command.includes('test:integration:node')) < executed.findIndex((command) => command.includes('related')),