fix(e2e): keep kitchen-sink process snapshots wide

This commit is contained in:
Vincent Koc
2026-06-01 15:09:33 +02:00
parent c0e49a2c52
commit 44b388f863
2 changed files with 11 additions and 6 deletions

View File

@@ -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);

View File

@@ -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",