

























@@ -3,6 +3,7 @@ import { spawn, spawnSync, type ChildProcess } from "node:child_process";
33import { existsSync, mkdtempSync, readFileSync, rmSync } from "node:fs";
44import { tmpdir } from "node:os";
55import path from "node:path";
6+import { MAX_TIMER_TIMEOUT_MS } from "@openclaw/normalization-core/number-coercion";
67import { describe, expect, it, vi } from "vitest";
78import {
89isRunWithEnvHelpRequest,
@@ -152,6 +153,11 @@ describe("run-with-env", () => {
152153it("rejects malformed force-kill grace configuration before spawning", () => {
153154expect(resolveForceKillDelayMs({})).toBe(5_000);
154155expect(resolveForceKillDelayMs({ OPENCLAW_RUN_WITH_ENV_FORCE_KILL_MS: "250" })).toBe(250);
156+expect(
157+resolveForceKillDelayMs({
158+OPENCLAW_RUN_WITH_ENV_FORCE_KILL_MS: String(MAX_TIMER_TIMEOUT_MS + 1),
159+}),
160+).toBe(MAX_TIMER_TIMEOUT_MS);
155161for (const value of ["0", "-1", "1e3", "100ms"]) {
156162expect(() => resolveForceKillDelayMs({ OPENCLAW_RUN_WITH_ENV_FORCE_KILL_MS: value })).toThrow(
157163"OPENCLAW_RUN_WITH_ENV_FORCE_KILL_MS must be a positive integer",
@@ -393,7 +399,10 @@ describe("run-with-env", () => {
393399],
394400{
395401cwd: process.cwd(),
396-env: { ...process.env, OPENCLAW_RUN_WITH_ENV_FORCE_KILL_MS: "1000" },
402+env: {
403+ ...process.env,
404+OPENCLAW_RUN_WITH_ENV_FORCE_KILL_MS: String(MAX_TIMER_TIMEOUT_MS + 1),
405+},
397406stdio: "ignore",
398407},
399408);
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。