From 3fe40ce5532b621dc3d41073573b107d632200fe Mon Sep 17 00:00:00 2001 From: JUN <243035832+lidge-jun@users.noreply.github.com> Date: Thu, 29 Oct 2026 15:01:18 +0900 Subject: [PATCH] test(codebuddy): feed the abort fixture's stdout once read() pushed and scheduled another abort on every call, flooding the stream until the abort landed; the SIGTERM case took ~1.3s idle and timed out in loaded full-suite jobs. It now takes ~12ms. --- tests/providers/codebuddy-adapter.test.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/providers/codebuddy-adapter.test.ts b/tests/providers/codebuddy-adapter.test.ts index f5b7ee7f68c..9132a4b652f 100644 --- a/tests/providers/codebuddy-adapter.test.ts +++ b/tests/providers/codebuddy-adapter.test.ts @@ -680,9 +680,14 @@ describe("codebuddy runTurn streams a headless turn", () => { test("an in-flight abort kills the child process gracefully with SIGTERM", async () => { const controller = new AbortController(); + let fed = false; const stdoutStream = new Readable({ read() { - // Feed one partial delta then abort before result + // Feed one partial delta then abort before result. Feed it once: a read() that pushes on + // every call floods the stream and the timer queue until the abort lands, which took + // seconds under a full single-job suite and timed this case out. + if (fed) return; + fed = true; this.push(enc.encode('{"type":"stream_event","event":{"type":"content_block_delta","delta":{"type":"text_delta","text":"start"}}}\n')); setTimeout(() => controller.abort(), 5); },