




















@@ -26,6 +26,7 @@ import {
2626resolveVitestNodeArgs,
2727resolveVitestNoOutputTimeoutMs,
2828resolveVitestSpawnParams,
29+spawnWatchedVitestProcess,
2930shouldSuppressVitestStderrLine,
3031} from "../../scripts/run-vitest.mjs";
3132@@ -798,6 +799,26 @@ describe("scripts/run-vitest", () => {
798799});
799800});
800801802+posixIt("terminates a silent Vitest child through the watchdog", async () => {
803+const watched = spawnWatchedVitestProcess({
804+pnpmArgs: ["exec", "node", "-e", "setInterval(() => {}, 1000)"],
805+spawnParams: {
806+detached: true,
807+stdio: ["ignore", "pipe", "pipe"],
808+},
809+env: { OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS: "100" },
810+});
811+812+try {
813+expect(await waitForClose(watched.child)).toEqual({ code: null, signal: "SIGTERM" });
814+} finally {
815+watched.teardown();
816+if (watched.child.pid && isProcessAlive(watched.child.pid)) {
817+process.kill(-watched.child.pid, "SIGKILL");
818+}
819+}
820+});
821+801822it("reenables local check policy for local Vitest children", () => {
802823expect(
803824resolveVitestSpawnParams(
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。