Skip to content

Commit e6e4ca7

Browse files
cameroncookeclaude
andcommitted
test(snapshot): Restore 120s timeouts and normalize Xcode running line
Drop CLI and MCP snapshot command timeouts from 300s back to 120s now that the device diagnostics hang is prevented upstream. Longer timeouts only masked the wedge and slowed the suite. Also normalize the doctor resource's "Xcode running" line so the fixture no longer depends on whether Xcode happens to be open during a run, and add a `test:snapshot:device` script for targeted reruns of the device snapshot file. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent d1f9b61 commit e6e4ca7

5 files changed

Lines changed: 5 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"test": "vitest run",
4949
"test:schema-fixtures": "vitest run --config vitest.snapshot.config.ts src/snapshot-tests/__tests__/json-fixture-schema.test.ts",
5050
"test:snapshot": "npm run build && node build/cli.js daemon stop 2>/dev/null; vitest run --config vitest.snapshot.config.ts",
51+
"test:snapshot:device": "npm run build && node build/cli.js daemon stop 2>/dev/null; vitest run --config vitest.snapshot.config.ts src/snapshot-tests/__tests__/device.snapshot.test.ts",
5152
"test:snapshot:update": "npm run build && node build/cli.js daemon stop 2>/dev/null; UPDATE_SNAPSHOTS=1 vitest run --config vitest.snapshot.config.ts",
5253
"test:smoke": "npm run build && vitest run --config vitest.smoke.config.ts",
5354
"test:watch": "vitest",

src/snapshot-tests/__fixtures__/mcp/resources/doctor--success.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ Runtime Tool Registration
102102
Xcode IDE Bridge (mcpbridge)
103103
Workflow enabled: No
104104
mcpbridge path: <XCODE_PATH>
105-
Xcode running: (unknown)
105+
Xcode running: <XCODE_RUNNING>
106106
Connected: No
107107
Bridge PID: (none)
108108
Proxied tools: 0

src/snapshot-tests/harness.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { SnapshotResult, WorkflowSnapshotHarness } from './contracts.ts';
66
import { resolveSnapshotToolManifest } from './tool-manifest-resolver.ts';
77

88
const CLI_PATH = path.resolve(process.cwd(), 'build/cli.js');
9-
const SNAPSHOT_COMMAND_TIMEOUT_MS = 300_000;
9+
const SNAPSHOT_COMMAND_TIMEOUT_MS = 120_000;
1010
const SIMULATOR_STATE_WAIT_TIMEOUT_MS = 15_000;
1111
const SIMULATOR_STATE_POLL_INTERVAL_MS = 250;
1212

src/snapshot-tests/mcp-harness.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type { SnapshotResult, WorkflowSnapshotHarness } from './contracts.ts';
77
import { resolveSnapshotToolManifest } from './tool-manifest-resolver.ts';
88

99
const CLI_PATH = path.resolve(process.cwd(), 'build/cli.js');
10-
const MCP_TOOL_TIMEOUT_MS = 300_000;
10+
const MCP_TOOL_TIMEOUT_MS = 120_000;
1111
const MCP_SNAPSHOT_PARITY_WORKFLOWS = [
1212
'coverage',
1313
'debugging',

src/snapshot-tests/normalize.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ export function normalizeSnapshotOutput(text: string): string {
221221
/ mcpbridge path: \/Applications\/Xcode[^\n]+/g,
222222
' mcpbridge path: <XCODE_PATH>',
223223
);
224+
normalized = normalized.replace(/^( {2}Xcode running: ).+$/gm, '$1<XCODE_RUNNING>');
224225
normalized = normalized.replace(/ Total Unique Tools: \d+/g, ' Total Unique Tools: <COUNT>');
225226
normalized = normalized.replace(/ Workflow Count: \d+/g, ' Workflow Count: <COUNT>');
226227
normalized = normalized.replace(/ (\w[\w-]*): \d+ tools$/gm, ' $1: <N> tools');

0 commit comments

Comments
 (0)