From a2dc90765cc1d588df87e08951827226c8e2d776 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 10 Aug 2026 16:34:59 -0700 Subject: [PATCH] test(bench): trim shared helper duplicates (#121745) --- scripts/bench-gateway-startup.ts | 11 +---------- test/scripts/bench-gateway-startup.test.ts | 14 -------------- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/scripts/bench-gateway-startup.ts b/scripts/bench-gateway-startup.ts index d0acc07fbdf5..a5816d7a5c5a 100644 --- a/scripts/bench-gateway-startup.ts +++ b/scripts/bench-gateway-startup.ts @@ -6,12 +6,7 @@ import path from "node:path"; import { performance } from "node:perf_hooks"; import { pathToFileURL } from "node:url"; import { delay, stopChild } from "./lib/gateway-bench-child.ts"; -import { - getFreePort, - parseProcessRssKb, - readProcessRssMb, - readProcessTreeCpuMs, -} from "./lib/gateway-bench-probes.ts"; +import { getFreePort, readProcessRssMb, readProcessTreeCpuMs } from "./lib/gateway-bench-probes.ts"; import { BASE_GATEWAY_BENCH_CONFIG, buildGatewayBenchChildArgs, @@ -832,10 +827,6 @@ export const testing = { collectResultFailures, collectStartupTrace, parseOptions, - parseNonNegativeInt, - parsePositiveInt, - parseProcessRssKb, - resolveEntry, sanitizedEnv, stopChild, summarizeCase, diff --git a/test/scripts/bench-gateway-startup.test.ts b/test/scripts/bench-gateway-startup.test.ts index 690224ba607c..a1078f61d4f2 100644 --- a/test/scripts/bench-gateway-startup.test.ts +++ b/test/scripts/bench-gateway-startup.test.ts @@ -55,8 +55,6 @@ describe("gateway startup benchmark script", () => { it("rejects ambiguous benchmark CLI values before spawning Node", () => { expect(() => testing.parseOptions(["--wat"])).toThrow("Unknown argument: --wat"); - expect(testing.parsePositiveInt("5", 1, "--runs")).toBe(5); - expect(testing.parseNonNegativeInt("0", 1, "--warmup")).toBe(0); expect( testing.parseOptions([ "--case", @@ -76,9 +74,6 @@ describe("gateway startup benchmark script", () => { output: "startup.json", runs: 2, }); - expect(() => testing.parsePositiveInt("2abc", 1, "--runs")).toThrow( - /--runs must be an integer/u, - ); expect(() => testing.parseOptions(["--output", "--case", "default"])).toThrow( "--output requires a value", ); @@ -92,7 +87,6 @@ describe("gateway startup benchmark script", () => { expect(() => testing.parseOptions(["--output", "first.json", "--output", "second.json"]), ).toThrow("--output was provided more than once"); - expect(() => testing.resolveEntry("--inspect")).toThrow(/must be a file path/u); }); it("rejects unknown benchmark CLI args before running cases", () => { @@ -154,14 +148,6 @@ describe("gateway startup benchmark script", () => { expect(env.OPENCLAW_GATEWAY_STARTUP_TRACE).toBe("1"); }); - it("rejects malformed ps RSS samples", () => { - expect(testing.parseProcessRssKb("2048\n")).toBe(2048); - expect(testing.parseProcessRssKb("2048kb\n")).toBeNull(); - expect(testing.parseProcessRssKb("2048 4096\n")).toBeNull(); - expect(testing.parseProcessRssKb("0\n")).toBeNull(); - expect(testing.parseProcessRssKb("")).toBeNull(); - }); - it("classifies HTTP listen and gateway ready logs separately", () => { expect( testing.classifyGatewayReadyLog("[gateway] http server listening (0 plugins, 0.8s)"),