mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-25 11:55:47 -06:00
fead7fee27
* refactor: consolidate small shared helpers * fix: reject inherited Parallels smoke arguments * fix: preserve day-prefixed CPU probe times
17 lines
590 B
TypeScript
17 lines
590 B
TypeScript
import { spawnSync } from "node:child_process";
|
|
import { describe, expect, it, vi } from "vitest";
|
|
import { readProcessTreeCpuMs } from "../../scripts/lib/gateway-bench-probes.ts";
|
|
|
|
vi.mock("node:child_process", () => ({ spawnSync: vi.fn() }));
|
|
|
|
describe("gateway benchmark process probes", () => {
|
|
it.skipIf(process.platform === "win32")("parses day-prefixed process-tree CPU times", () => {
|
|
vi.mocked(spawnSync).mockReturnValue({
|
|
status: 0,
|
|
stdout: "123 1 1-02:03:04\n124 123 01:02\n",
|
|
} as never);
|
|
|
|
expect(readProcessTreeCpuMs(123)).toBe(93_846_000);
|
|
});
|
|
});
|