(what, probe, attempts = 90)
| 213 | } |
| 214 | |
| 215 | async function waitFor(what, probe, attempts = 90) { |
| 216 | for (let i = 0; i < attempts; i++) { |
| 217 | try { |
| 218 | if (await probe()) return true; |
| 219 | } catch { |
| 220 | /* not up yet */ |
| 221 | } |
| 222 | await sleep(1000); |
| 223 | } |
| 224 | throw new Error(`timed out waiting for ${what}`); |
| 225 | } |
| 226 | |
| 227 | async function main() { |
| 228 | const browserPath = findBrowser(); |