fix(e2e): give cleanup smoke build heap headroom · openclaw/openclaw@e3bab80
vincentkoc
·
2026-06-19
·
via Recent Commits to openclaw:main
File tree
scripts/docker/cleanup-smoke
| Original file line number | Diff line number | Diff line change |
|---|
@@ -43,6 +43,19 @@ print_log_tail() {
|
43 | 43 | |
44 | 44 | read_positive_int_env OPENCLAW_CLEANUP_SMOKE_LOG_PRINT_BYTES 65536 >/dev/null |
45 | 45 | |
| 46 | +ensure_cleanup_smoke_node_options() { |
| 47 | +local current="${NODE_OPTIONS:-}" |
| 48 | +case " $current " in |
| 49 | +*" --max-old-space-size="* | *" --max-old-space-size "* | *" --max_old_space_size="* | *" --max_old_space_size "*) |
| 50 | + ;; |
| 51 | +*) |
| 52 | + current="${current:+$current }--max-old-space-size=8192" |
| 53 | + ;; |
| 54 | +esac |
| 55 | +export NODE_OPTIONS="$current" |
| 56 | +} |
| 57 | +ensure_cleanup_smoke_node_options |
| 58 | + |
46 | 59 | echo "==> Build" |
47 | 60 | if ! pnpm build >/tmp/openclaw-cleanup-build.log 2>&1; then |
48 | 61 | print_log_tail /tmp/openclaw-cleanup-build.log |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -246,6 +246,19 @@ docker_build_transient_failure "$LOG_PATH"
|
246 | 246 | expect(cleanupRun).not.toContain("cat /tmp/openclaw-cleanup-"); |
247 | 247 | }); |
248 | 248 | |
| 249 | +it("gives cleanup-smoke builds enough Node heap while preserving explicit callers", () => { |
| 250 | +const cleanupRun = readFileSync(CLEANUP_SMOKE_RUN_PATH, "utf8"); |
| 251 | + |
| 252 | +expect(cleanupRun).toContain("ensure_cleanup_smoke_node_options()"); |
| 253 | +expect(cleanupRun).toContain("export NODE_OPTIONS=\"$current\""); |
| 254 | +expect(cleanupRun).toContain("--max-old-space-size=8192"); |
| 255 | +expect(cleanupRun).toContain("*\" --max-old-space-size=\"*"); |
| 256 | +expect(cleanupRun).toContain("*\" --max_old_space_size=\"*"); |
| 257 | +expect(cleanupRun.indexOf("ensure_cleanup_smoke_node_options")).toBeLessThan( |
| 258 | +cleanupRun.indexOf("pnpm build >/tmp/openclaw-cleanup-build.log"), |
| 259 | +); |
| 260 | +}); |
| 261 | + |
249 | 262 | it("rejects invalid cleanup-smoke log byte limits", () => { |
250 | 263 | const workDir = mkdtempSync(join(tmpdir(), "openclaw-cleanup-smoke-log-invalid-")); |
251 | 264 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。