Skip to content

Commit e593f94

Browse files
committed
test(ios-runner): keep the retry test file at its ratchet length
1 parent 1df8c24 commit e593f94

1 file changed

Lines changed: 15 additions & 24 deletions

File tree

‎packages/platform-apple/src/runner/__tests__/runner-command-retry.test.ts‎

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -545,32 +545,23 @@ test('read-only commands retry when completed status has no retained response',
545545
});
546546

547547
test('read-only startup commands measure readiness from the session launch deadline', async () => {
548-
vi.useFakeTimers();
549-
try {
550-
vi.setSystemTime(1_000);
551-
const session = makeRunnerSession({
552-
port: 8100,
553-
state: 'starting',
554-
launchDeadline: Deadline.fromTimeoutMs(240_000),
555-
});
556-
557-
mockEnsureRunnerSession.mockImplementationOnce(async () => {
558-
vi.setSystemTime(41_000);
559-
return session;
560-
});
561-
mockExecuteRunnerCommandWithSession.mockResolvedValue({ currentUptimeMs: 42 });
548+
vi.useFakeTimers({ now: 1_000 });
549+
const session = makeRunnerSession({
550+
port: 8100,
551+
state: 'starting',
552+
launchDeadline: Deadline.fromTimeoutMs(240_000),
553+
});
554+
mockEnsureRunnerSession.mockImplementationOnce(async () => {
555+
vi.setSystemTime(41_000);
556+
return session;
557+
});
558+
mockExecuteRunnerCommandWithSession.mockResolvedValue({ currentUptimeMs: 42 });
562559

563-
const result = await runAppleRunnerCommand(
564-
IOS_SIMULATOR,
565-
{ command: 'uptime' },
566-
{ startupTimeoutMs: 240_000 },
567-
);
560+
const result = await runAppleRunnerCommand(IOS_SIMULATOR, { command: 'uptime' });
561+
vi.useRealTimers();
568562

569-
assert.deepEqual(result, { currentUptimeMs: 42 });
570-
assert.equal(mockExecuteRunnerCommandWithSession.mock.calls[0]?.[4], 200_000);
571-
} finally {
572-
vi.useRealTimers();
573-
}
563+
assert.deepEqual(result, { currentUptimeMs: 42 });
564+
assert.equal(mockExecuteRunnerCommandWithSession.mock.calls[0]?.[4], 200_000);
574565
});
575566

576567
test('read-only commands retry when status shows in-flight work', async () => {

0 commit comments

Comments
 (0)