(expected: boolean)
| 79 | : `curl -s -o /dev/null -w '%{http_code}' --max-time 3 http://127.0.0.1:${PORT}/api/health`; |
| 80 | |
| 81 | const waitForGuestHealth = async (expected: boolean): Promise<boolean> => { |
| 82 | const deadline = Date.now() + 30_000; |
| 83 | for (;;) { |
| 84 | const result = await ssh(healthStatusCommand()); |
| 85 | const healthy = result.stdout.trim() === "200"; |
| 86 | if (healthy === expected) return true; |
| 87 | if (Date.now() >= deadline) return false; |
| 88 | await new Promise((resolve) => setTimeout(resolve, 500)); |
| 89 | } |
| 90 | }; |
| 91 | |
| 92 | const listenerPid = async (): Promise<string> => |
| 93 | ( |
no test coverage detected