From b30e4e69efe59652c119b7b4f6f92c690ed33c66 Mon Sep 17 00:00:00 2001 From: ework-agent Date: Sun, 4 Oct 2026 13:52:23 +0800 Subject: [PATCH] test(responses-ws): await side-request log line instead of racing the flush (#2040) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The title-persona test was the last reader in this file still using a raw synchronous fs.readFileSync right after turn completion. On loaded runners the tee-logger write lags the wire completion, so the snapshot misses a line that was logically already emitted — observed as a red windows-latest/Node 22 cell in PR #2034's CI (run 37179443315), green on re-run, green on the other three matrix cells. Use the established readLogUntil() polling helper (added by 97ff7810 for exactly this race class, #1968). Both original assertions are unchanged and now vet the settled snapshot. --- tests/responses-websocket.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/responses-websocket.test.ts b/tests/responses-websocket.test.ts index ca11303f81..0414cf5503 100644 --- a/tests/responses-websocket.test.ts +++ b/tests/responses-websocket.test.ts @@ -668,7 +668,7 @@ test("Responses WS: a title-persona side request rides the lane transport instea const events = await f.turn([user("title over the WS lane")], undefined, {}, titlePeer); const done = events.find(e => e.type === "response.completed"); assert.ok(done, JSON.stringify(events)); - const log = fs.readFileSync(f.logPath, "utf8"); + const log = await readLogUntil(f.logPath, [/side request \(agent=title\)/]); assert.match(log, /side request \(agent=title\)/); assert.doesNotMatch(log, /Unsupported request in Responses WebSocket transport/); } finally {