























@@ -5,6 +5,7 @@ import fsPromises from "node:fs/promises";
55import path from "node:path";
66import { pathToFileURL } from "node:url";
77import { describe, expect, it, vi } from "vitest";
8+import { resolveWindowsTaskkillPath } from "../../scripts/lib/windows-taskkill.mjs";
89import {
910cleanTsdownOutputRoots,
1011createTsdownOutputScanner,
@@ -25,6 +26,10 @@ const NO_MEMORY_LIMIT = {
2526procMeminfoPath: "/openclaw-test-missing-proc-meminfo",
2627};
272829+function expectedTaskkillPath(): string {
30+return resolveWindowsTaskkillPath();
31+}
32+2833async function expectPathMissing(targetPath: string) {
2934let statError: unknown;
3035try {
@@ -671,17 +676,22 @@ describe("runTsdownBuildInvocation", () => {
671676platform: "win32",
672677 runTaskkill,
673678});
674-expect(runTaskkill).toHaveBeenNthCalledWith(1, "taskkill", ["/PID", "123", "/T"], {
679+expect(runTaskkill).toHaveBeenNthCalledWith(1, expectedTaskkillPath(), ["/PID", "123", "/T"], {
675680stdio: "ignore",
676681});
677682678683signalTsdownBuildProcessTree({ pid: 123, kill: childKill }, "SIGKILL", {
679684platform: "win32",
680685 runTaskkill,
681686});
682-expect(runTaskkill).toHaveBeenNthCalledWith(2, "taskkill", ["/PID", "123", "/T", "/F"], {
683-stdio: "ignore",
684-});
687+expect(runTaskkill).toHaveBeenNthCalledWith(
688+2,
689+expectedTaskkillPath(),
690+["/PID", "123", "/T", "/F"],
691+{
692+stdio: "ignore",
693+},
694+);
685695expect(childKill).not.toHaveBeenCalled();
686696});
687697@@ -697,12 +707,17 @@ describe("runTsdownBuildInvocation", () => {
697707 runTaskkill,
698708});
699709700-expect(runTaskkill).toHaveBeenNthCalledWith(1, "taskkill", ["/PID", "123", "/T"], {
701-stdio: "ignore",
702-});
703-expect(runTaskkill).toHaveBeenNthCalledWith(2, "taskkill", ["/PID", "123", "/T", "/F"], {
710+expect(runTaskkill).toHaveBeenNthCalledWith(1, expectedTaskkillPath(), ["/PID", "123", "/T"], {
704711stdio: "ignore",
705712});
713+expect(runTaskkill).toHaveBeenNthCalledWith(
714+2,
715+expectedTaskkillPath(),
716+["/PID", "123", "/T", "/F"],
717+{
718+stdio: "ignore",
719+},
720+);
706721expect(childKill).not.toHaveBeenCalled();
707722});
708723此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。