From 3738373aa5ff0fff074ecb95686ef952c209957e Mon Sep 17 00:00:00 2001 From: 0x1f99d Date: Mon, 9 Mar 2026 14:36:03 +1100 Subject: [PATCH] fix(server): use waitForPush in terminal event broadcast test to prevent flaky failure (#606) The terminal RPC test used raw waitForMessage to receive the expected terminal.event push, but a server.configUpdated push from the keybindings file watcher can arrive first depending on OS timing. Replace with the existing waitForPush helper that filters by channel. --- apps/server/src/wsServer.test.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/apps/server/src/wsServer.test.ts b/apps/server/src/wsServer.test.ts index 285028cca6e85e3613cafdd10a6e2986e31a2073..80d57d7c6f9c730d4f518bed5ac301be496786f9 100644 --- a/apps/server/src/wsServer.test.ts +++ b/apps/server/src/wsServer.test.ts @@ -1333,9 +1333,7 @@ describe("WebSocket Server", () => { }; terminalManager.emitEvent(manualEvent); - const push = (await waitForMessage(ws)) as WsPush; - expect(push.type).toBe("push"); - expect(push.channel).toBe(WS_CHANNELS.terminalEvent); + const push = await waitForPush(ws, WS_CHANNELS.terminalEvent); expect((push.data as TerminalEvent).type).toBe("output"); }); -- 2.54.0