fix(e2e): give cleanup smoke build heap headroom

This commit is contained in:
Vincent Koc
2026-06-19 01:50:54 +02:00
parent 7207072436
commit e3bab80bda
2 changed files with 26 additions and 0 deletions

View File

@@ -43,6 +43,19 @@ print_log_tail() {
read_positive_int_env OPENCLAW_CLEANUP_SMOKE_LOG_PRINT_BYTES 65536 >/dev/null
ensure_cleanup_smoke_node_options() {
local current="${NODE_OPTIONS:-}"
case " $current " in
*" --max-old-space-size="* | *" --max-old-space-size "* | *" --max_old_space_size="* | *" --max_old_space_size "*)
;;
*)
current="${current:+$current }--max-old-space-size=8192"
;;
esac
export NODE_OPTIONS="$current"
}
ensure_cleanup_smoke_node_options
echo "==> Build"
if ! pnpm build >/tmp/openclaw-cleanup-build.log 2>&1; then
print_log_tail /tmp/openclaw-cleanup-build.log

View File

@@ -246,6 +246,19 @@ docker_build_transient_failure "$LOG_PATH"
expect(cleanupRun).not.toContain("cat /tmp/openclaw-cleanup-");
});
it("gives cleanup-smoke builds enough Node heap while preserving explicit callers", () => {
const cleanupRun = readFileSync(CLEANUP_SMOKE_RUN_PATH, "utf8");
expect(cleanupRun).toContain("ensure_cleanup_smoke_node_options()");
expect(cleanupRun).toContain("export NODE_OPTIONS=\"$current\"");
expect(cleanupRun).toContain("--max-old-space-size=8192");
expect(cleanupRun).toContain("*\" --max-old-space-size=\"*");
expect(cleanupRun).toContain("*\" --max_old_space_size=\"*");
expect(cleanupRun.indexOf("ensure_cleanup_smoke_node_options")).toBeLessThan(
cleanupRun.indexOf("pnpm build >/tmp/openclaw-cleanup-build.log"),
);
});
it("rejects invalid cleanup-smoke log byte limits", () => {
const workDir = mkdtempSync(join(tmpdir(), "openclaw-cleanup-smoke-log-invalid-"));