mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 05:51:15 +08:00
fix(e2e): fail fast when gateway exits before readiness
This commit is contained in:
@@ -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`, {
|
||||
|
||||
Reference in New Issue
Block a user