(phase: 'outage' | 'recovery', rounds: number)
| 1264 | |
| 1265 | const pollResults: Array<{ phase: 'outage' | 'recovery'; status: 'success' | 'timeout' | 'error' }> = []; |
| 1266 | const pollLoop = async (phase: 'outage' | 'recovery', rounds: number) => { |
| 1267 | for (let i = 0; i < rounds; i++) { |
| 1268 | try { |
| 1269 | await timedGet(); |
| 1270 | pollResults.push({ phase, status: 'success' }); |
| 1271 | } catch (err) { |
| 1272 | const message = (err as { message?: string })?.message; |
| 1273 | pollResults.push({ |
| 1274 | phase, |
| 1275 | status: message === '1s Timeout' ? 'timeout' : 'error' |
| 1276 | }); |
| 1277 | } |
| 1278 | await setTimeout(3000); |
| 1279 | } |
| 1280 | }; |
| 1281 | |
| 1282 | // Match the issue's periodic GET calls while outage is active. |
| 1283 | await pollLoop('outage', 3); |
no test coverage detected