fix(e2e): cancel readiness probe bodies · openclaw/openclaw@8480ef3
vincentkoc
·
2026-06-19
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -474,14 +474,16 @@ openclaw_e2e_probe_http() {
|
474 | 474 | const controller = new AbortController(); |
475 | 475 | const timer = setTimeout(() => controller.abort(), timeoutMs); |
476 | 476 | let exitCode = 1; |
| 477 | + let response; |
477 | 478 | try { |
478 | | - const response = await fetch(process.argv[1], { signal: controller.signal }); |
| 479 | + response = await fetch(process.argv[1], { signal: controller.signal }); |
479 | 480 | const passed = expected === "ok" ? response.ok : response.status === Number(expected); |
480 | 481 | exitCode = passed ? 0 : 1; |
481 | 482 | } catch { |
482 | 483 | exitCode = 1; |
483 | 484 | } finally { |
484 | 485 | clearTimeout(timer); |
| 486 | + await response?.body?.cancel?.().catch(() => undefined); |
485 | 487 | } |
486 | 488 | process.exit(exitCode); |
487 | 489 | ' "$1" "${2:-ok}" "${3:-400}" |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -849,6 +849,12 @@ exit 1
|
849 | 849 | } |
850 | 850 | }); |
851 | 851 | |
| 852 | +it("cancels HTTP readiness probe response bodies", () => { |
| 853 | +const helper = fs.readFileSync(helperPath, "utf8"); |
| 854 | + |
| 855 | +expect(helper).toContain("await response?.body?.cancel?.().catch(() => undefined);"); |
| 856 | +}); |
| 857 | + |
852 | 858 | it("does not repeatedly grep the full gateway log while waiting for readiness", () => { |
853 | 859 | const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-e2e-readyz-incremental-")); |
854 | 860 | try { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。