From 44b388f86385b640505d7c1cdfd2bc94b1abcf95 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Mon, 1 Jun 2026 15:09:33 +0200 Subject: [PATCH] fix(e2e): keep kitchen-sink process snapshots wide --- scripts/e2e/kitchen-sink-rpc-walk.mjs | 5 +++-- test/scripts/kitchen-sink-rpc-walk.test.ts | 12 ++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/scripts/e2e/kitchen-sink-rpc-walk.mjs b/scripts/e2e/kitchen-sink-rpc-walk.mjs index d03a0cb7905..747771cd516 100644 --- a/scripts/e2e/kitchen-sink-rpc-walk.mjs +++ b/scripts/e2e/kitchen-sink-rpc-walk.mjs @@ -43,6 +43,7 @@ const DEFAULT_PORT = 19000 + Math.floor(Math.random() * 1000); const LOG_SCAN_CHUNK_BYTES = 64 * 1024; const LOG_SCAN_MAX_LINE_CHARS = 16 * 1024; const LOG_TAIL_BYTES = 256 * 1024; +const POSIX_PROCESS_SNAPSHOT_ARGS = ["-ww", "-axo", "pid=,ppid=,rss=,pcpu=,command="]; const ERROR_LOG_DENY_PATTERNS = [ /\buncaught exception\b/iu, /\bunhandled rejection\b/iu, @@ -1034,7 +1035,7 @@ async function samplePosixProcessWithDescendants(pid, run) { return null; } try { - const { stdout } = await run("ps", ["-axo", "pid=,ppid=,rss=,pcpu=,command="], { + const { stdout } = await run("ps", POSIX_PROCESS_SNAPSHOT_ARGS, { timeoutMs: 5000, }); const rows = parsePosixProcessRows(stdout); @@ -1054,7 +1055,7 @@ async function samplePosixProcessTree(pid, run, commandLineNeedles) { return null; } try { - const { stdout } = await run("ps", ["-axo", "pid=,ppid=,rss=,pcpu=,command="], { + const { stdout } = await run("ps", POSIX_PROCESS_SNAPSHOT_ARGS, { timeoutMs: 5000, }); const rows = parsePosixProcessRows(stdout); diff --git a/test/scripts/kitchen-sink-rpc-walk.test.ts b/test/scripts/kitchen-sink-rpc-walk.test.ts index 8edacc4a284..fbc9f46ab15 100644 --- a/test/scripts/kitchen-sink-rpc-walk.test.ts +++ b/test/scripts/kitchen-sink-rpc-walk.test.ts @@ -137,7 +137,9 @@ describe("kitchen-sink RPC gateway teardown", () => { throw error; }); - await expect(stopGateway(child, { killGraceMs: 1, teardownGraceMs: 1 })).resolves.toBeUndefined(); + await expect( + stopGateway(child, { killGraceMs: 1, teardownGraceMs: 1 }), + ).resolves.toBeUndefined(); expect(child.kill).toHaveBeenCalledOnce(); }); @@ -152,7 +154,9 @@ describe("kitchen-sink RPC gateway teardown", () => { child.signalCode = null; child.kill = vi.fn(() => false); - await expect(stopGateway(child, { killGraceMs: 1, teardownGraceMs: 1 })).resolves.toBeUndefined(); + await expect( + stopGateway(child, { killGraceMs: 1, teardownGraceMs: 1 }), + ).resolves.toBeUndefined(); expect(child.kill).toHaveBeenCalledOnce(); }); @@ -621,7 +625,7 @@ describe("kitchen-sink RPC process sampling", () => { platform: "linux", runCommand: async (command: string, args: string[]) => { expect(command).toBe("ps"); - expect(args).toEqual(["-axo", "pid=,ppid=,rss=,pcpu=,command="]); + expect(args).toEqual(["-ww", "-axo", "pid=,ppid=,rss=,pcpu=,command="]); return { stdout: [ " 4321 1 262144 12.5 node dist/index.js gateway --port 19080", @@ -646,7 +650,7 @@ describe("kitchen-sink RPC process sampling", () => { posixCommandLineNeedles: ["gateway", "--port", "19080"], runCommand: async (command: string, args: string[]) => { expect(command).toBe("ps"); - expect(args).toEqual(["-axo", "pid=,ppid=,rss=,pcpu=,command="]); + expect(args).toEqual(["-ww", "-axo", "pid=,ppid=,rss=,pcpu=,command="]); return { stdout: [ " 4321 1 16384 0.0 node /usr/local/bin/corepack pnpm openclaw gateway --port 19080",