Skip to content

Commit 2c6bc38

Browse files
committed
fix(apple): preserve runner warmth on boot memo hits
1 parent a3aa98b commit 2c6bc38

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

‎packages/platform-apple/src/readiness/runtime.test.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ test('recent native boot observation avoids a duplicate simulator listing', asyn
1111
exitCode: 0,
1212
}));
1313
const markBooted = vi.fn();
14+
const keepHot = vi.fn();
1415
const host = platformRuntimeHostFixture();
1516

1617
await ensureAppleReady(
@@ -20,7 +21,7 @@ test('recent native boot observation avoids a duplicate simulator listing', asyn
2021
deviceReadiness: {
2122
...host.deviceReadiness,
2223
appleAutomation: {
23-
keepHot: vi.fn(),
24+
keepHot,
2425
markBooted,
2526
wasRecentlyObservedBooted: vi.fn(async () => true),
2627
},
@@ -32,6 +33,7 @@ test('recent native boot observation avoids a duplicate simulator listing', asyn
3233

3334
expect(run).not.toHaveBeenCalled();
3435
expect(markBooted).not.toHaveBeenCalled();
36+
expect(keepHot).toHaveBeenCalledOnce();
3537
});
3638

3739
test('plain device boot state does not bypass native readiness observation', async () => {

‎packages/platform-apple/src/readiness/runtime.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ export async function ensureAppleReady(
4545
if (device.kind !== 'simulator') return { ...device, booted: true };
4646

4747
const recentlyObservedBooted = await readRecentBootObservation(host, device);
48-
if (recentlyObservedBooted) return { ...device, booted: true };
48+
if (recentlyObservedBooted) {
49+
host.deviceReadiness.appleAutomation.keepHot(device);
50+
return { ...device, booted: true };
51+
}
4952
const state = await simulatorState(host, device, signal);
5053
if (state !== 'Booted') {
5154
options.onColdBootStart?.();

0 commit comments

Comments
 (0)