






















@@ -7,6 +7,7 @@ import os from "node:os";
77import path from "node:path";
88import { afterEach, describe, expect, it, vi } from "vitest";
99import { createPnpmRunnerSpawnSpec } from "../../../scripts/pnpm-runner.mjs";
10+import { getWindowsSystem32ExePath } from "../../../src/infra/windows-install-roots.js";
1011import { createNodeEvalArgs } from "../../../src/test-utils/node-process.js";
11121213type CommandResult = {
@@ -100,12 +101,13 @@ function signalCommandProcess(
100101if (signal === "SIGKILL") {
101102args.push("/F");
102103}
103-const result = runTaskkill("taskkill", args, { stdio: "ignore", windowsHide: true });
104+const taskkillPath = getWindowsSystem32ExePath("taskkill.exe");
105+const result = runTaskkill(taskkillPath, args, { stdio: "ignore", windowsHide: true });
104106if (!result.error && result.status === 0) {
105107return;
106108}
107109if (signal !== "SIGKILL") {
108-const forceResult = runTaskkill("taskkill", [...args, "/F"], {
110+const forceResult = runTaskkill(taskkillPath, [...args, "/F"], {
109111stdio: "ignore",
110112windowsHide: true,
111113});
@@ -303,11 +305,12 @@ describe("OpenClaw SDK package e2e", () => {
303305304306signalCommandProcess(child, "SIGTERM", runTaskkill);
305307306-expect(runTaskkill).toHaveBeenNthCalledWith(1, "taskkill", ["/PID", "12345", "/T"], {
308+const taskkillPath = getWindowsSystem32ExePath("taskkill.exe");
309+expect(runTaskkill).toHaveBeenNthCalledWith(1, taskkillPath, ["/PID", "12345", "/T"], {
307310stdio: "ignore",
308311windowsHide: true,
309312});
310-expect(runTaskkill).toHaveBeenNthCalledWith(2, "taskkill", ["/PID", "12345", "/T", "/F"], {
313+expect(runTaskkill).toHaveBeenNthCalledWith(2, taskkillPath, ["/PID", "12345", "/T", "/F"], {
311314stdio: "ignore",
312315windowsHide: true,
313316});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。