Skip to content

Commit 17dc990

Browse files
committed
test(scripts): use true overflow timer inputs
1 parent 540ec53 commit 17dc990

7 files changed

Lines changed: 15 additions & 23 deletions

test/scripts/check-extension-package-tsc-boundary.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import fs from "node:fs";
55
import os from "node:os";
66
import path from "node:path";
77
import { pathToFileURL } from "node:url";
8-
import { MAX_TIMER_TIMEOUT_MS } from "@openclaw/normalization-core/number-coercion";
98
import { afterEach, describe, expect, it } from "vitest";
109
import {
1110
acquireBoundaryCheckLock,
@@ -438,7 +437,7 @@ describe("check-extension-package-tsc-boundary", () => {
438437
runNodeStepAsync(
439438
"slow-success",
440439
["--eval", "setTimeout(() => process.exit(0), 25);"],
441-
MAX_TIMER_TIMEOUT_MS + 1,
440+
Number.MAX_SAFE_INTEGER,
442441
),
443442
).resolves.toMatchObject({
444443
stderr: "",

test/scripts/docker-all-scheduler.test.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { chmodSync, existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync
44
import { tmpdir } from "node:os";
55
import path from "node:path";
66
import { setTimeout as delay } from "node:timers/promises";
7-
import { MAX_TIMER_TIMEOUT_MS } from "@openclaw/normalization-core/number-coercion";
87
import { describe, expect, it } from "vitest";
98
import { DEFAULT_RESOURCE_LIMITS } from "../../scripts/lib/docker-e2e-plan.mjs";
109
import {
@@ -484,8 +483,8 @@ postgres Created
484483
)}`,
485484
env: process.env,
486485
label: "oversized-command-timeout",
487-
timeoutKillGraceMs: MAX_TIMER_TIMEOUT_MS + 1,
488-
timeoutMs: MAX_TIMER_TIMEOUT_MS + 1,
486+
timeoutKillGraceMs: Number.MAX_SAFE_INTEGER,
487+
timeoutMs: Number.MAX_SAFE_INTEGER,
489488
});
490489

491490
expect(result).toMatchObject({
@@ -502,7 +501,7 @@ postgres Created
502501
)}`,
503502
env: process.env,
504503
label: "oversized-no-output-timeout",
505-
noOutputTimeoutMs: MAX_TIMER_TIMEOUT_MS + 1,
504+
noOutputTimeoutMs: Number.MAX_SAFE_INTEGER,
506505
timeoutMs: 5_000,
507506
});
508507

@@ -520,8 +519,8 @@ postgres Created
520519
)}`,
521520
env: process.env,
522521
label: "oversized-capture-timeout",
523-
timeoutKillGraceMs: MAX_TIMER_TIMEOUT_MS + 1,
524-
timeoutMs: MAX_TIMER_TIMEOUT_MS + 1,
522+
timeoutKillGraceMs: Number.MAX_SAFE_INTEGER,
523+
timeoutMs: Number.MAX_SAFE_INTEGER,
525524
});
526525

527526
expect(result).toMatchObject({
@@ -609,7 +608,7 @@ setInterval(() => {}, 1000);
609608
command: `exec ${JSON.stringify(process.execPath)} ${JSON.stringify(scriptPath)}`,
610609
env: process.env,
611610
label: "oversized-timeout-grace",
612-
timeoutKillGraceMs: MAX_TIMER_TIMEOUT_MS + 1,
611+
timeoutKillGraceMs: Number.MAX_SAFE_INTEGER,
613612
timeoutMs: 500,
614613
});
615614

test/scripts/parallels-npm-update-smoke.test.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
import { chmodSync, existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
33
import { tmpdir } from "node:os";
44
import path from "node:path";
5-
import {
6-
MAX_TIMER_TIMEOUT_MS,
7-
MAX_TIMER_TIMEOUT_SECONDS,
8-
} from "@openclaw/normalization-core/number-coercion";
5+
import { MAX_TIMER_TIMEOUT_MS } from "@openclaw/normalization-core/number-coercion";
96
import { afterEach, describe, expect, it, vi } from "vitest";
107
import { runWindowsBackgroundPowerShell } from "../../scripts/e2e/parallels/guest-transports.ts";
118
import { run as hostCommandRun } from "../../scripts/e2e/parallels/host-command.ts";
@@ -411,7 +408,7 @@ exit 1
411408
});
412409

413410
withEnv(
414-
{ OPENCLAW_PARALLELS_NPM_UPDATE_FRESH_TIMEOUT_S: String(MAX_TIMER_TIMEOUT_SECONDS + 1) },
411+
{ OPENCLAW_PARALLELS_NPM_UPDATE_FRESH_TIMEOUT_S: String(Number.MAX_SAFE_INTEGER) },
415412
() => {
416413
expect(freshLaneTimeoutMs("linux")).toBe(MAX_TIMER_TIMEOUT_MS);
417414
},
@@ -428,7 +425,7 @@ exit 1
428425
logPath,
429426
{},
430427
undefined,
431-
{ timeoutMs: MAX_TIMER_TIMEOUT_MS + 1 },
428+
{ timeoutMs: Number.MAX_SAFE_INTEGER },
432429
);
433430

434431
expect(code).toBe(0);

test/scripts/parallels-update-job-timeout.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ describe("Parallels update job timeout", () => {
4242
label: "Linux",
4343
run: async () => undefined,
4444
timeoutDescription: "oversized",
45-
timeoutMs: MAX_TIMER_TIMEOUT_MS + 1,
45+
timeoutMs: Number.MAX_SAFE_INTEGER,
4646
writeLog,
4747
}),
4848
).resolves.toBe(0);

test/scripts/plugin-gateway-gauntlet.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import os from "node:os";
55
import path from "node:path";
66
import { setTimeout as delay } from "node:timers/promises";
77
import { pathToFileURL } from "node:url";
8-
import { MAX_TIMER_TIMEOUT_MS } from "@openclaw/normalization-core/number-coercion";
98
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
109
import {
1110
buildObservationGuardFailures,
@@ -592,8 +591,8 @@ describe("plugin gateway gauntlet helpers", () => {
592591
args: ["-e", "setTimeout(() => process.exit(0), 25)"],
593592
label: "oversized-timeout",
594593
phase: "probe",
595-
timeoutKillGraceMs: MAX_TIMER_TIMEOUT_MS + 1,
596-
timeoutMs: MAX_TIMER_TIMEOUT_MS + 1,
594+
timeoutKillGraceMs: Number.MAX_SAFE_INTEGER,
595+
timeoutMs: Number.MAX_SAFE_INTEGER,
597596
timeMode: "none",
598597
});
599598

test/scripts/pnpm-audit-prod.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import { mkdtemp, rm, writeFile } from "node:fs/promises";
33
import { tmpdir } from "node:os";
44
import path from "node:path";
5-
import { MAX_TIMER_TIMEOUT_MS } from "@openclaw/normalization-core/number-coercion";
65
import { describe, expect, it } from "vitest";
76
import {
87
collectProdResolvedPackagesFromLockfile,
@@ -279,7 +278,7 @@ snapshots:
279278
let signal: AbortSignal | undefined;
280279
const request = fetchBulkAdvisories({
281280
payload: { axios: ["1.0.0"] },
282-
timeoutMs: MAX_TIMER_TIMEOUT_MS + 1,
281+
timeoutMs: Number.MAX_SAFE_INTEGER,
283282
fetchImpl: (async (_url, init) => {
284283
signal = init?.signal ?? undefined;
285284
await new Promise<void>((resolve, reject) => {

test/scripts/run-additional-boundary-checks.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { spawn, spawnSync } from "node:child_process";
33
import fs from "node:fs";
44
import os from "node:os";
55
import path from "node:path";
6-
import { MAX_TIMER_TIMEOUT_MS } from "@openclaw/normalization-core/number-coercion";
76
import { describe, expect, it } from "vitest";
87
import {
98
BOUNDARY_CHECKS,
@@ -279,7 +278,7 @@ describe("run-additional-boundary-checks", () => {
279278
args: ["-e", "setTimeout(() => process.exit(0), 25)"],
280279
},
281280
{
282-
checkTimeoutMs: MAX_TIMER_TIMEOUT_MS + 1,
281+
checkTimeoutMs: Number.MAX_SAFE_INTEGER,
283282
cwd: process.cwd(),
284283
env: process.env,
285284
outputMaxBytes: 4096,

0 commit comments

Comments
 (0)