mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-07 10:34:44 +00:00
fix(scripts): clamp boundary check timers
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user