Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/webworker/src/launch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1642,6 +1642,13 @@ describe('launch — RelaunchedAfterCrash needs evidence', () => {
lifecycleEventsListener: (type) => seen.push(type),
}),
);
// The dead-sibling recovery reads IndexedDB asynchronously and can lag arbitrarily on a loaded CI runner,
// so a fixed sleep raced it (the RelaunchedAfterCrash flake). Wait for the event for a bounded time; the
// cases that expect silence simply run out the clock. A short tail lets a (wrong) second emission land.
const deadline = Date.now() + 1500;
while (!seen.includes(LifecycleEvents.RelaunchedAfterCrash) && Date.now() < deadline) {
await new Promise((r) => setTimeout(r, 25));
}
await new Promise((r) => setTimeout(r, 50));
return seen;
};
Expand Down