From 408349b7acd44e9a13a6851a96702ca201b91215 Mon Sep 17 00:00:00 2001 From: zouyanjian Date: Fri, 23 Oct 2026 21:00:35 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=B5=E8=84=91=E4=BB=A3=E7=90=86=E3=80=8Cst?= =?UTF-8?q?din=20=E5=85=B3=E9=97=AD=E5=90=8E=E5=81=9C=E6=9C=BA=E3=80=8D?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E4=B8=8D=E5=86=8D=E7=94=A8=205=20=E7=A7=92?= =?UTF-8?q?=E5=A2=99=E9=92=9F=EF=BC=8C=E6=94=B9=E6=88=90=E9=80=80=E5=87=BA?= =?UTF-8?q?=E5=92=8C=E7=BB=A7=E7=BB=AD=E9=87=8D=E8=BF=9E=E8=B5=9B=E8=B7=91?= =?UTF-8?q?=20(#79)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Be3SZps2JjqvyrJ1vbLmni --- packages/computer-agent/test/process.test.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/computer-agent/test/process.test.ts b/packages/computer-agent/test/process.test.ts index d80f2fb1..ca99aedc 100644 --- a/packages/computer-agent/test/process.test.ts +++ b/packages/computer-agent/test/process.test.ts @@ -258,6 +258,8 @@ describe("电脑代理进程", () => { 60_000, ); + // 没有墙钟阈值:从起到退的大头是 tsx 冷编译整棵模块树,CI 并行跑满 CPU 时单这段就要四五秒,量不出停机本身。 + // 没认 stdin 关闭的话代理会一直连 NOWHERE,第二条重连日志先到。 it("stdin 关闭后代理自己停机", async () => { const child = spawnAgent({}); const dataDir = await createDataDir(); @@ -272,11 +274,12 @@ describe("电脑代理进程", () => { try { child.stdin.end(); - await expect(child.waitForExit(5_000)).resolves.toBe("退出 0"); + const winner = await Promise.race([child.waitForExit(), child.waitForOutput("后重连,第 2 次")]); + expect(winner, `输出:${child.output()}`).toBe("退出 0"); } finally { if (child.process.exitCode === null) child.process.kill("SIGKILL"); } - }, 15_000); + }, 60_000); it("welcome 后 stdout 输出固定 online JSON 标记", async () => { const server = await startWelcomeServer();