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
6 changes: 4 additions & 2 deletions packages/platform-android/src/__tests__/screenshot.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,10 @@ test('screenshotAndroid drops a display rotation probe still running after the c
facts = result;
});
// The image is written through real file I/O; the only timer this path installs is the
// grace that starts once the write is done. Yield to I/O until it exists.
for (let turn = 0; turn < 1_000 && vi.getTimerCount() === 0; turn++) {
// grace that starts once the write is done. Yield to I/O until it exists, bounded by wall
// time because a loaded thread pool can take any number of event-loop turns to finish it.
const writeDeadline = performance.now() + 10_000;
while (vi.getTimerCount() === 0 && performance.now() < writeDeadline) {
await new Promise((resolve) => setImmediate(resolve));
}
assert.equal(vi.getTimerCount(), 1, 'the capture must start one grace timer once written');
Expand Down
Loading