(conn: Conn, type: string, timeoutMs: number)
| 162 | } |
| 163 | |
| 164 | async function receiveType(conn: Conn, type: string, timeoutMs: number): Promise<WsFrame> { |
| 165 | const deadline = Date.now() + timeoutMs; |
| 166 | for (;;) { |
| 167 | const remaining = deadline - Date.now(); |
| 168 | if (remaining <= 0) throw new Error(`no message of type ${type} within ${String(timeoutMs)}ms`); |
| 169 | const frame = await receive(conn, remaining); |
| 170 | if (frame.type === type) return frame; |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | async function waitForRegistrySize( |
| 175 | r: RunningServer, |
no test coverage detected