fix(scripts): clamp boundary check timers

This commit is contained in:
Vincent Koc
2026-06-22 02:54:24 +02:00
parent fe7b78b05f
commit 08442c4b38
2 changed files with 30 additions and 5 deletions

View File

@@ -5,6 +5,7 @@ import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import { pathToFileURL } from "node:url";
import { MAX_TIMER_TIMEOUT_MS } from "@openclaw/normalization-core/number-coercion";
import { afterEach, describe, expect, it } from "vitest";
import {
acquireBoundaryCheckLock,
@@ -432,6 +433,19 @@ describe("check-extension-package-tsc-boundary", () => {
expect(elapsedMs).toBeGreaterThanOrEqual(0);
}, 30_000);
it("clamps oversized async node step timers before scheduling", async () => {
await expect(
runNodeStepAsync(
"slow-success",
["--eval", "setTimeout(() => process.exit(0), 25);"],
MAX_TIMER_TIMEOUT_MS + 1,
),
).resolves.toMatchObject({
stderr: "",
stdout: "",
});
});
it("keeps async node step failure output bounded", async () => {
const child = new EventEmitter() as EventEmitter & {
kill: (signal?: NodeJS.Signals | number) => boolean;