Skip to content

Commit b439ba2

Browse files
committed
test(ios): synchronize helper crashes with request dispatch
1 parent 173881f commit b439ba2

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

packages/platform-apple/src/snapshot-source/lifecycle.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ test('a crashed helper is removed and the next request starts a fresh helper', a
251251
const fixture = createLifecycleFixture({ responseDelayMs: 80 });
252252
const manager = new SnapshotBridgeManager(fixture.host);
253253
const request = manager.request({ target, bridge, limits, maxDepth: 10, deadline: deadline() });
254-
setTimeout(() => fixture.processes[0]?.crash(), 10);
254+
await waitForDispatch(fixture);
255+
fixture.processes[0]!.crash();
255256

256257
await assert.rejects(
257258
request,
@@ -269,7 +270,8 @@ test('a crashed helper emits its bounded log once and keeps exit facts typed', a
269270
const fixture = createLifecycleFixture({ responseDelayMs: 80 });
270271
const manager = new SnapshotBridgeManager(fixture.host);
271272
const request = manager.request({ target, bridge, limits, maxDepth: 10, deadline: deadline() });
272-
setTimeout(() => fixture.processes[0]?.crash(), 10);
273+
await waitForDispatch(fixture);
274+
fixture.processes[0]!.crash();
273275
let failure: SnapshotSourceError | undefined;
274276

275277
await assert.rejects(request, (error: unknown) => {

0 commit comments

Comments
 (0)