fix(package): force taskkill candidate runner trees on windows · openclaw/openclaw@4b2298e
vincentkoc
·
2026-06-21
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -240,6 +240,30 @@ describe("resolve-openclaw-package-candidate", () => {
|
240 | 240 | expect(child.kill).not.toHaveBeenCalled(); |
241 | 241 | }); |
242 | 242 | |
| 243 | +it("force-kills Windows package runner process trees when graceful taskkill fails", () => { |
| 244 | +const child = { |
| 245 | +kill: vi.fn(), |
| 246 | +pid: 12345, |
| 247 | +}; |
| 248 | +const runTaskkill = vi |
| 249 | +.fn() |
| 250 | +.mockReturnValueOnce({ error: undefined, status: 1 }) |
| 251 | +.mockReturnValueOnce({ error: undefined, status: 0 }); |
| 252 | + |
| 253 | +signalChildProcessTree(child, "SIGTERM", { |
| 254 | +platform: "win32", |
| 255 | + runTaskkill, |
| 256 | +}); |
| 257 | + |
| 258 | +expect(runTaskkill).toHaveBeenNthCalledWith(1, "taskkill", ["/PID", "12345", "/T"], { |
| 259 | +stdio: "ignore", |
| 260 | +}); |
| 261 | +expect(runTaskkill).toHaveBeenNthCalledWith(2, "taskkill", ["/PID", "12345", "/T", "/F"], { |
| 262 | +stdio: "ignore", |
| 263 | +}); |
| 264 | +expect(child.kill).not.toHaveBeenCalled(); |
| 265 | +}); |
| 266 | + |
243 | 267 | it("keeps npm pack filenames inside the package candidate output directory", async () => { |
244 | 268 | const dir = await mkdtemp(path.join(tmpdir(), "openclaw-package-npm-pack-")); |
245 | 269 | tempDirs.push(dir); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。