fix(e2e): cancel readiness probe bodies

This commit is contained in:
Vincent Koc
2026-06-19 08:18:01 +02:00
parent fc1bdecf08
commit 8480ef3f86
2 changed files with 9 additions and 1 deletions
+3 -1
View File
@@ -474,14 +474,16 @@ openclaw_e2e_probe_http() {
const controller = new AbortController();
const timer = setTimeout(() => controller.abort(), timeoutMs);
let exitCode = 1;
let response;
try {
const response = await fetch(process.argv[1], { signal: controller.signal });
response = await fetch(process.argv[1], { signal: controller.signal });
const passed = expected === "ok" ? response.ok : response.status === Number(expected);
exitCode = passed ? 0 : 1;
} catch {
exitCode = 1;
} finally {
clearTimeout(timer);
await response?.body?.cancel?.().catch(() => undefined);
}
process.exit(exitCode);
' "$1" "${2:-ok}" "${3:-400}"
@@ -849,6 +849,12 @@ exit 1
}
});
it("cancels HTTP readiness probe response bodies", () => {
const helper = fs.readFileSync(helperPath, "utf8");
expect(helper).toContain("await response?.body?.cancel?.().catch(() => undefined);");
});
it("does not repeatedly grep the full gateway log while waiting for readiness", () => {
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-e2e-readyz-incremental-"));
try {