Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/computer-agent/test/process.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ describe("电脑代理进程", () => {
60_000,
);

// 没有墙钟阈值:从起到退的大头是 tsx 冷编译整棵模块树,CI 并行跑满 CPU 时单这段就要四五秒,量不出停机本身。
// 没认 stdin 关闭的话代理会一直连 NOWHERE,第二条重连日志先到。
it("stdin 关闭后代理自己停机", async () => {
const child = spawnAgent({});
const dataDir = await createDataDir();
Expand All @@ -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();
Expand Down
Loading