From cf00cda2163e515709de8e2961ba23b6db266783 Mon Sep 17 00:00:00 2001 From: Mike Schwarz <171890339+mvschwarz@users.noreply.github.com> Date: Tue, 20 Oct 2026 06:30:20 -0700 Subject: [PATCH] test(cli): separate HTTP error cases from chatroom wait deadline (#1609) Test only. Four `rig chatroom wait` cases in `chatroom.test.ts` check how an HTTP error from the daemon (404, 500, 503 with an empty or null body) is reported. They used a 0.05-second `--timeout`, which could expire before the stubbed error was reported, so the test sometimes saw the timeout instead. They now use 30 seconds, so each ends on the stubbed error. Fractional deadlines are still tested by their own cases. --- packages/cli/test/chatroom.test.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/cli/test/chatroom.test.ts b/packages/cli/test/chatroom.test.ts index 80f468b16..ef4945fc1 100644 --- a/packages/cli/test/chatroom.test.ts +++ b/packages/cli/test/chatroom.test.ts @@ -316,14 +316,15 @@ describe("Chatroom CLI", () => { expect(parsed[0].sender).toBe("alice"); }); + // HTTP errors must settle before the command deadline; fractional deadlines are tested below. it.each([ ["history", [], 404, { error: "Rig removed" }], ["history", ["--json"], 500, { error: "History unavailable" }], - ["wait", ["--timeout", "0.05"], 404, { error: "Rig removed" }], - ["wait", ["--timeout", "0.05", "--json"], 500, { error: "History unavailable" }], + ["wait", ["--timeout", "30"], 404, { error: "Rig removed" }], + ["wait", ["--timeout", "30", "--json"], 500, { error: "History unavailable" }], ["history", [], 503, {}], - ["wait", ["--timeout", "0.05"], 503, {}], - ["wait", ["--timeout", "0.05"], 503, null], + ["wait", ["--timeout", "30"], 503, {}], + ["wait", ["--timeout", "30"], 503, null], ] as const)("chatroom %s reports an HTTP error (%s, %s)", async (command, options, status, body) => { historyFailure = { status, body }; capturedUrls.length = 0;