test: stabilize doctor + bash tool tests

This commit is contained in:
Peter Steinberger
2026-01-08 23:44:54 +01:00
parent 4360d1106d
commit 2f1ce51b2c
2 changed files with 11 additions and 1 deletions

View File

@@ -10,6 +10,7 @@ import { sanitizeBinaryOutput } from "./shell-utils.js";
const isWin = process.platform === "win32";
const shortDelayCmd = isWin ? "ping -n 2 127.0.0.1 > nul" : "sleep 0.05";
const yieldDelayCmd = isWin ? "ping -n 3 127.0.0.1 > nul" : "sleep 0.2";
const longDelayCmd = isWin ? "ping -n 4 127.0.0.1 > nul" : "sleep 2";
const joinCommands = (commands: string[]) =>
commands.join(isWin ? " & " : "; ");
@@ -51,7 +52,7 @@ beforeEach(() => {
describe("bash tool backgrounding", () => {
it("backgrounds after yield and can be polled", async () => {
const result = await bashTool.execute("call1", {
command: echoAfterDelay("done"),
command: joinCommands([yieldDelayCmd, "echo done"]),
yieldMs: 10,
});