From 17dc9902f2a8b8e9aa5f42eb3760311995264c73 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Mon, 22 Jun 2026 05:05:54 +0200 Subject: [PATCH] test(scripts): use true overflow timer inputs --- .../check-extension-package-tsc-boundary.test.ts | 3 +-- test/scripts/docker-all-scheduler.test.ts | 13 ++++++------- test/scripts/parallels-npm-update-smoke.test.ts | 9 +++------ test/scripts/parallels-update-job-timeout.test.ts | 2 +- test/scripts/plugin-gateway-gauntlet.test.ts | 5 ++--- test/scripts/pnpm-audit-prod.test.ts | 3 +-- test/scripts/run-additional-boundary-checks.test.ts | 3 +-- 7 files changed, 15 insertions(+), 23 deletions(-) diff --git a/test/scripts/check-extension-package-tsc-boundary.test.ts b/test/scripts/check-extension-package-tsc-boundary.test.ts index 04df853da310..8156b31fa490 100644 --- a/test/scripts/check-extension-package-tsc-boundary.test.ts +++ b/test/scripts/check-extension-package-tsc-boundary.test.ts @@ -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: "", diff --git a/test/scripts/docker-all-scheduler.test.ts b/test/scripts/docker-all-scheduler.test.ts index 0b0dfdf502c0..05cc8e619f54 100644 --- a/test/scripts/docker-all-scheduler.test.ts +++ b/test/scripts/docker-all-scheduler.test.ts @@ -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, }); diff --git a/test/scripts/parallels-npm-update-smoke.test.ts b/test/scripts/parallels-npm-update-smoke.test.ts index dfdff6f83821..effa714b8186 100644 --- a/test/scripts/parallels-npm-update-smoke.test.ts +++ b/test/scripts/parallels-npm-update-smoke.test.ts @@ -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); diff --git a/test/scripts/parallels-update-job-timeout.test.ts b/test/scripts/parallels-update-job-timeout.test.ts index 9e9233f253cb..dd7f93f1a91c 100644 --- a/test/scripts/parallels-update-job-timeout.test.ts +++ b/test/scripts/parallels-update-job-timeout.test.ts @@ -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); diff --git a/test/scripts/plugin-gateway-gauntlet.test.ts b/test/scripts/plugin-gateway-gauntlet.test.ts index 9e5a6334b7c9..bba3b77d8941 100644 --- a/test/scripts/plugin-gateway-gauntlet.test.ts +++ b/test/scripts/plugin-gateway-gauntlet.test.ts @@ -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", }); diff --git a/test/scripts/pnpm-audit-prod.test.ts b/test/scripts/pnpm-audit-prod.test.ts index c90b41928e8a..6338880c4896 100644 --- a/test/scripts/pnpm-audit-prod.test.ts +++ b/test/scripts/pnpm-audit-prod.test.ts @@ -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((resolve, reject) => { diff --git a/test/scripts/run-additional-boundary-checks.test.ts b/test/scripts/run-additional-boundary-checks.test.ts index a01a73a082af..4c0e5ac70407 100644 --- a/test/scripts/run-additional-boundary-checks.test.ts +++ b/test/scripts/run-additional-boundary-checks.test.ts @@ -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,