(check: () => Promise<boolean>, timeoutMs: number)
| 42 | } |
| 43 | |
| 44 | async function waitFor(check: () => Promise<boolean>, timeoutMs: number): Promise<boolean> { |
| 45 | const deadline = Date.now() + timeoutMs; |
| 46 | while (Date.now() < deadline) { |
| 47 | if (await check()) return true; |
| 48 | await new Promise((r) => setTimeout(r, 100)); |
| 49 | } |
| 50 | return check(); |
| 51 | } |
| 52 | |
| 53 | // Every case drives real catch-up syncs and waits for them (see the gate note |
| 54 | // below), so each gets room for a loaded Windows VM; cases that do more set |
no test coverage detected