test(scripts): use true overflow timer inputs

This commit is contained in:
Vincent Koc
2026-06-22 05:05:54 +02:00
parent 540ec53f99
commit 17dc9902f2
7 changed files with 15 additions and 23 deletions

View File

@@ -5,7 +5,6 @@ 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,
@@ -438,7 +437,7 @@ describe("check-extension-package-tsc-boundary", () => {
runNodeStepAsync(
"slow-success",
["--eval", "setTimeout(() => process.exit(0), 25);"],
MAX_TIMER_TIMEOUT_MS + 1,
Number.MAX_SAFE_INTEGER,
),
).resolves.toMatchObject({
stderr: "",

View File

@@ -4,7 +4,6 @@ import { chmodSync, existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync
import { tmpdir } from "node:os";
import path from "node:path";
import { setTimeout as delay } from "node:timers/promises";
import { MAX_TIMER_TIMEOUT_MS } from "@openclaw/normalization-core/number-coercion";
import { describe, expect, it } from "vitest";
import { DEFAULT_RESOURCE_LIMITS } from "../../scripts/lib/docker-e2e-plan.mjs";
import {
@@ -484,8 +483,8 @@ postgres Created
)}`,
env: process.env,
label: "oversized-command-timeout",
timeoutKillGraceMs: MAX_TIMER_TIMEOUT_MS + 1,
timeoutMs: MAX_TIMER_TIMEOUT_MS + 1,
timeoutKillGraceMs: Number.MAX_SAFE_INTEGER,
timeoutMs: Number.MAX_SAFE_INTEGER,
});
expect(result).toMatchObject({
@@ -502,7 +501,7 @@ postgres Created
)}`,
env: process.env,
label: "oversized-no-output-timeout",
noOutputTimeoutMs: MAX_TIMER_TIMEOUT_MS + 1,
noOutputTimeoutMs: Number.MAX_SAFE_INTEGER,
timeoutMs: 5_000,
});
@@ -520,8 +519,8 @@ postgres Created
)}`,
env: process.env,
label: "oversized-capture-timeout",
timeoutKillGraceMs: MAX_TIMER_TIMEOUT_MS + 1,
timeoutMs: MAX_TIMER_TIMEOUT_MS + 1,
timeoutKillGraceMs: Number.MAX_SAFE_INTEGER,
timeoutMs: Number.MAX_SAFE_INTEGER,
});
expect(result).toMatchObject({
@@ -609,7 +608,7 @@ setInterval(() => {}, 1000);
command: `exec ${JSON.stringify(process.execPath)} ${JSON.stringify(scriptPath)}`,
env: process.env,
label: "oversized-timeout-grace",
timeoutKillGraceMs: MAX_TIMER_TIMEOUT_MS + 1,
timeoutKillGraceMs: Number.MAX_SAFE_INTEGER,
timeoutMs: 500,
});

View File

@@ -2,10 +2,7 @@
import { chmodSync, existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import path from "node:path";
import {
MAX_TIMER_TIMEOUT_MS,
MAX_TIMER_TIMEOUT_SECONDS,
} from "@openclaw/normalization-core/number-coercion";
import { MAX_TIMER_TIMEOUT_MS } from "@openclaw/normalization-core/number-coercion";
import { afterEach, describe, expect, it, vi } from "vitest";
import { runWindowsBackgroundPowerShell } from "../../scripts/e2e/parallels/guest-transports.ts";
import { run as hostCommandRun } from "../../scripts/e2e/parallels/host-command.ts";
@@ -411,7 +408,7 @@ exit 1
});
withEnv(
{ OPENCLAW_PARALLELS_NPM_UPDATE_FRESH_TIMEOUT_S: String(MAX_TIMER_TIMEOUT_SECONDS + 1) },
{ OPENCLAW_PARALLELS_NPM_UPDATE_FRESH_TIMEOUT_S: String(Number.MAX_SAFE_INTEGER) },
() => {
expect(freshLaneTimeoutMs("linux")).toBe(MAX_TIMER_TIMEOUT_MS);
},
@@ -428,7 +425,7 @@ exit 1
logPath,
{},
undefined,
{ timeoutMs: MAX_TIMER_TIMEOUT_MS + 1 },
{ timeoutMs: Number.MAX_SAFE_INTEGER },
);
expect(code).toBe(0);

View File

@@ -42,7 +42,7 @@ describe("Parallels update job timeout", () => {
label: "Linux",
run: async () => undefined,
timeoutDescription: "oversized",
timeoutMs: MAX_TIMER_TIMEOUT_MS + 1,
timeoutMs: Number.MAX_SAFE_INTEGER,
writeLog,
}),
).resolves.toBe(0);

View File

@@ -5,7 +5,6 @@ import os from "node:os";
import path from "node:path";
import { setTimeout as delay } from "node:timers/promises";
import { pathToFileURL } from "node:url";
import { MAX_TIMER_TIMEOUT_MS } from "@openclaw/normalization-core/number-coercion";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import {
buildObservationGuardFailures,
@@ -592,8 +591,8 @@ describe("plugin gateway gauntlet helpers", () => {
args: ["-e", "setTimeout(() => process.exit(0), 25)"],
label: "oversized-timeout",
phase: "probe",
timeoutKillGraceMs: MAX_TIMER_TIMEOUT_MS + 1,
timeoutMs: MAX_TIMER_TIMEOUT_MS + 1,
timeoutKillGraceMs: Number.MAX_SAFE_INTEGER,
timeoutMs: Number.MAX_SAFE_INTEGER,
timeMode: "none",
});

View File

@@ -2,7 +2,6 @@
import { mkdtemp, rm, writeFile } from "node:fs/promises";
import { tmpdir } from "node:os";
import path from "node:path";
import { MAX_TIMER_TIMEOUT_MS } from "@openclaw/normalization-core/number-coercion";
import { describe, expect, it } from "vitest";
import {
collectProdResolvedPackagesFromLockfile,
@@ -279,7 +278,7 @@ snapshots:
let signal: AbortSignal | undefined;
const request = fetchBulkAdvisories({
payload: { axios: ["1.0.0"] },
timeoutMs: MAX_TIMER_TIMEOUT_MS + 1,
timeoutMs: Number.MAX_SAFE_INTEGER,
fetchImpl: (async (_url, init) => {
signal = init?.signal ?? undefined;
await new Promise<void>((resolve, reject) => {

View File

@@ -3,7 +3,6 @@ import { spawn, spawnSync } from "node:child_process";
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import { MAX_TIMER_TIMEOUT_MS } from "@openclaw/normalization-core/number-coercion";
import { describe, expect, it } from "vitest";
import {
BOUNDARY_CHECKS,
@@ -279,7 +278,7 @@ describe("run-additional-boundary-checks", () => {
args: ["-e", "setTimeout(() => process.exit(0), 25)"],
},
{
checkTimeoutMs: MAX_TIMER_TIMEOUT_MS + 1,
checkTimeoutMs: Number.MAX_SAFE_INTEGER,
cwd: process.cwd(),
env: process.env,
outputMaxBytes: 4096,