mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-30 15:33:38 +00:00
fix(e2e): give cleanup smoke build heap headroom
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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-"));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user