(origin: string, timeoutMs: number)
| 169 | |
| 170 | /** Poll `/api/v1/healthz` until it reports healthy or `timeoutMs` elapses. */ |
| 171 | export async function waitForServerHealthy(origin: string, timeoutMs: number): Promise<boolean> { |
| 172 | const deadline = Date.now() + timeoutMs; |
| 173 | do { |
| 174 | if (await isServerHealthy(origin, 500)) { |
| 175 | return true; |
| 176 | } |
| 177 | await new Promise((resolve) => { |
| 178 | setTimeout(resolve, 200); |
| 179 | }); |
| 180 | } while (Date.now() < deadline); |
| 181 | return false; |
| 182 | } |
| 183 | |
| 184 | /** |
| 185 | * Probe `/` and confirm the bundled web UI is being served. |
no test coverage detected