From 2bf23133952d5083d59f9788ac75125b84ab4024 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Mon, 13 Apr 2026 20:36:52 -0500 Subject: [PATCH] test(tui): finalize sub-turn regression tests to stop pinned spinner The two new sub-turn shrink regression tests created a pinned DynamicBorder (via message_update with pinnable text + tool) but never emitted message_end, so the spinner's setInterval kept the test process alive until CI timed out after 15 minutes. Append a message_end to each test so the module-level pinnedBorder is torn down. --- .../src/core/chat-controller-ordering.test.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/pi-coding-agent/src/core/chat-controller-ordering.test.ts b/packages/pi-coding-agent/src/core/chat-controller-ordering.test.ts index c03db913d..ae24d455d 100644 --- a/packages/pi-coding-agent/src/core/chat-controller-ordering.test.ts +++ b/packages/pi-coding-agent/src/core/chat-controller-ordering.test.ts @@ -758,6 +758,9 @@ test("chat-controller freezes prior sub-turn and appends new segments when conte assert.equal(host.chatContainer.children.length, 5, "new tool appends after new text-run"); assert.equal(host.chatContainer.children[4]?.constructor?.name, "ToolExecutionComponent"); assert.notEqual(host.chatContainer.children[4], priorT1, "new T2 must be a different component from prior T1"); + + // Finalize so the module-level pinned spinner (setInterval) is torn down and the test process can exit. + await handleAgentEvent(host, { type: "message_end", message: makeAssistant([{ type: "text", text: "C" }, t2]) } as any); }); // Regression: after a sub-turn shrink, lastPinnedText must be cleared so the @@ -806,4 +809,7 @@ test("chat-controller updates pinned zone after sub-turn shrink", async () => { // Pinned markdown must now reflect the new sub-turn's text, not stay frozen on "first". assert.equal((pinnedMarkdown as any)?.text, "second", "pinned zone must update after sub-turn shrink (#4144 regression)"); + + // Finalize so the module-level pinned spinner (setInterval) is torn down and the test process can exit. + await handleAgentEvent(host, { type: "message_end", message: makeAssistant([{ type: "text", text: "second" }, t2]) } as any); });