fix(scripts): force taskkill boundary node steps on windows · openclaw/openclaw@4d17a52
vincentkoc
·
2026-06-21
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -149,6 +149,30 @@ describe("prepare-extension-package-boundary-artifacts", () => {
|
149 | 149 | expect(child.kill).not.toHaveBeenCalled(); |
150 | 150 | }); |
151 | 151 | |
| 152 | +it("force-kills Windows node step process trees when graceful taskkill fails", () => { |
| 153 | +const child = { |
| 154 | +kill: vi.fn(), |
| 155 | +pid: 12345, |
| 156 | +}; |
| 157 | +const runTaskkill = vi |
| 158 | +.fn() |
| 159 | +.mockReturnValueOnce({ error: undefined, status: 1 }) |
| 160 | +.mockReturnValueOnce({ error: undefined, status: 0 }); |
| 161 | + |
| 162 | +signalNodeStep(child, "SIGTERM", { |
| 163 | +platform: "win32", |
| 164 | + runTaskkill, |
| 165 | +}); |
| 166 | + |
| 167 | +expect(runTaskkill).toHaveBeenNthCalledWith(1, "taskkill", ["/PID", "12345", "/T"], { |
| 168 | +stdio: "ignore", |
| 169 | +}); |
| 170 | +expect(runTaskkill).toHaveBeenNthCalledWith(2, "taskkill", ["/PID", "12345", "/T", "/F"], { |
| 171 | +stdio: "ignore", |
| 172 | +}); |
| 173 | +expect(child.kill).not.toHaveBeenCalled(); |
| 174 | +}); |
| 175 | + |
152 | 176 | it.runIf(process.platform !== "win32")( |
153 | 177 | "force-kills aborted sibling step process groups", |
154 | 178 | async () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。