fix(runtime-smoke): force taskkill bundled trees on windows · openclaw/openclaw@273eb88
vincentkoc
·
2026-06-21
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -466,6 +466,31 @@ describe("bundled plugin install/uninstall probe", () => {
|
466 | 466 | expect(child.kill).not.toHaveBeenCalled(); |
467 | 467 | }); |
468 | 468 | |
| 469 | +it("force-kills Windows runtime child process trees when graceful taskkill fails", async () => { |
| 470 | +const runtimeSmoke = await import(pathToFileURL(runtimeSmokePath).href); |
| 471 | +const child = { |
| 472 | +kill: vi.fn(), |
| 473 | +pid: 12345, |
| 474 | +}; |
| 475 | +const runTaskkill = vi |
| 476 | +.fn() |
| 477 | +.mockReturnValueOnce({ error: undefined, status: 1 }) |
| 478 | +.mockReturnValueOnce({ error: undefined, status: 0 }); |
| 479 | + |
| 480 | +runtimeSmoke.signalChildProcessTree(child, "SIGTERM", { |
| 481 | +platform: "win32", |
| 482 | + runTaskkill, |
| 483 | +}); |
| 484 | + |
| 485 | +expect(runTaskkill).toHaveBeenNthCalledWith(1, "taskkill", ["/PID", "12345", "/T"], { |
| 486 | +stdio: "ignore", |
| 487 | +}); |
| 488 | +expect(runTaskkill).toHaveBeenNthCalledWith(2, "taskkill", ["/PID", "12345", "/T", "/F"], { |
| 489 | +stdio: "ignore", |
| 490 | +}); |
| 491 | +expect(child.kill).not.toHaveBeenCalled(); |
| 492 | +}); |
| 493 | + |
469 | 494 | it.runIf(process.platform !== "win32")("stops runtime gateway process groups", async () => { |
470 | 495 | const runtimeSmoke = await importRuntimeSmokeWithEnv({ |
471 | 496 | OPENCLAW_BUNDLED_PLUGIN_RUNTIME_TEARDOWN_GRACE_MS: "50", |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。