fix(gateway): quiet benchmark watch output

This commit is contained in:
Peter Steinberger
2026-05-04 23:36:18 +01:00
parent f042b53782
commit f8e080386d
4 changed files with 31 additions and 0 deletions

View File

@@ -89,6 +89,7 @@ describe("gateway-watch tmux wrapper", () => {
expect(code).toBe(0);
const command = spawnSync.mock.calls[1]?.[1]?.[6] as string;
expect(command).toContain("'OPENCLAW_RUN_NODE_CPU_PROF_DIR=.artifacts/gateway-watch-profiles'");
expect(command).toContain("'OPENCLAW_TRACE_SYNC_IO=0'");
expect(command).not.toContain("--benchmark");
expect(command).toContain("'gateway'");
expect(command).toContain("'--force'");
@@ -97,6 +98,31 @@ describe("gateway-watch tmux wrapper", () => {
);
});
it("preserves explicit sync I/O tracing in benchmark mode", () => {
const stdout = createOutput();
const stderr = createOutput();
const spawnSync = vi
.fn()
.mockReturnValueOnce({ status: 1, stdout: "", stderr: "" })
.mockReturnValueOnce({ status: 0, stdout: "", stderr: "" })
.mockReturnValueOnce({ status: 0, stdout: "", stderr: "" })
.mockReturnValueOnce({ status: 0, stdout: "", stderr: "" });
const code = runGatewayWatchTmuxMain({
args: ["gateway", "--force", "--benchmark"],
cwd: "/repo",
env: { OPENCLAW_TRACE_SYNC_IO: "1", SHELL: "/bin/zsh" },
nodePath: "/node",
spawnSync,
stderr: stderr.stream,
stdout: stdout.stream,
});
expect(code).toBe(0);
const command = spawnSync.mock.calls[1]?.[1]?.[6] as string;
expect(command).toContain("'OPENCLAW_TRACE_SYNC_IO=1'");
});
it("can remove --force from benchmarked watch runs", () => {
const stdout = createOutput();
const stderr = createOutput();