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