fix(crabbox): force taskkill telegram proof trees on windows · openclaw/openclaw@140a2fa
vincentkoc
·
2026-06-21
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -378,6 +378,30 @@ setInterval(() => {}, 1000);
|
378 | 378 | expect(child.kill).not.toHaveBeenCalled(); |
379 | 379 | }); |
380 | 380 | |
| 381 | +it("force-kills Windows proof command process trees when graceful taskkill fails", () => { |
| 382 | +const child = { |
| 383 | +kill: vi.fn(), |
| 384 | +pid: 12345, |
| 385 | +}; |
| 386 | +const runTaskkill = vi |
| 387 | +.fn() |
| 388 | +.mockReturnValueOnce({ error: undefined, status: 1 }) |
| 389 | +.mockReturnValueOnce({ error: undefined, status: 0 }); |
| 390 | + |
| 391 | +signalCommandTree(child, "SIGTERM", { |
| 392 | +platform: "win32", |
| 393 | + runTaskkill, |
| 394 | +}); |
| 395 | + |
| 396 | +expect(runTaskkill).toHaveBeenNthCalledWith(1, "taskkill", ["/PID", "12345", "/T"], { |
| 397 | +stdio: "ignore", |
| 398 | +}); |
| 399 | +expect(runTaskkill).toHaveBeenNthCalledWith(2, "taskkill", ["/PID", "12345", "/T", "/F"], { |
| 400 | +stdio: "ignore", |
| 401 | +}); |
| 402 | +expect(child.kill).not.toHaveBeenCalled(); |
| 403 | +}); |
| 404 | + |
381 | 405 | posixIt("lets timed-out command descendants exit during kill grace", async () => { |
382 | 406 | const root = makeTempDir(); |
383 | 407 | const scriptPath = path.join(root, "trap-term-grace.mjs"); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。