fix(e2e): fail fast when gateway exits before readiness

This commit is contained in:
Peter Steinberger
2026-05-29 00:23:48 +01:00
parent b4f03c2e64
commit 6a65cc5e9c

View File

@@ -714,9 +714,14 @@ export async function waitForGatewayReady(child, port, logPath, options = {}) {
const timeoutMs = Math.max(1, options.timeoutMs ?? READY_TIMEOUT_MS);
const pollDelayMs = Math.max(1, options.pollDelayMs ?? 250);
const logReportedReady = createGatewayReadyLogScanner(logPath);
const exitedBeforeReadyError = () =>
new Error(`gateway exited before ready\n${tailFile(logPath)}`);
if (hasChildExited(child)) {
throw exitedBeforeReadyError();
}
while (Date.now() - started < timeoutMs) {
if (hasChildExited(child)) {
throw new Error(`gateway exited before ready\n${tailFile(logPath)}`);
throw exitedBeforeReadyError();
}
try {
const readyz = await fetchJson(`http://127.0.0.1:${port}/readyz`, {