mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-05 15:52:57 +00:00
fix(e2e): keep kitchen-sink process snapshots wide
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user