mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
fix(e2e): cancel readiness probe bodies
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user