fix(testing): force taskkill group report trees on windows · openclaw/openclaw@3df5207
vincentkoc
·
2026-06-21
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -636,6 +636,30 @@ describe("scripts/test-group-report child process guard", () => {
|
636 | 636 | expect(child.kill).not.toHaveBeenCalled(); |
637 | 637 | }); |
638 | 638 | |
| 639 | +it("force-kills Windows child process trees when graceful taskkill fails", () => { |
| 640 | +const child = { |
| 641 | +kill: vi.fn(), |
| 642 | +pid: 12345, |
| 643 | +}; |
| 644 | +const runTaskkill = vi |
| 645 | +.fn() |
| 646 | +.mockReturnValueOnce({ error: undefined, status: 1 }) |
| 647 | +.mockReturnValueOnce({ error: undefined, status: 0 }); |
| 648 | + |
| 649 | +signalTestGroupReportChild(child, "SIGTERM", { |
| 650 | +platform: "win32", |
| 651 | + runTaskkill, |
| 652 | +}); |
| 653 | + |
| 654 | +expect(runTaskkill).toHaveBeenNthCalledWith(1, "taskkill", ["/PID", "12345", "/T"], { |
| 655 | +stdio: "ignore", |
| 656 | +}); |
| 657 | +expect(runTaskkill).toHaveBeenNthCalledWith(2, "taskkill", ["/PID", "12345", "/T", "/F"], { |
| 658 | +stdio: "ignore", |
| 659 | +}); |
| 660 | +expect(child.kill).not.toHaveBeenCalled(); |
| 661 | +}); |
| 662 | + |
639 | 663 | it("times out a child that ignores SIGTERM", async () => { |
640 | 664 | if (process.platform === "win32") { |
641 | 665 | return; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。