test(e2e): use temp dir helper in kitchen rpc timeout test · openclaw/openclaw@4005e03
vincentkoc
·
2026-06-18
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -57,6 +57,7 @@ import {
|
57 | 57 | usesBuiltOpenClawEntry, |
58 | 58 | waitForGatewayReady, |
59 | 59 | } from "../../scripts/e2e/kitchen-sink-rpc-walk.mjs"; |
| 60 | +import { cleanupTempDirs, makeTempDir } from "../helpers/temp-dir.js"; |
60 | 61 | |
61 | 62 | const posixIt = process.platform === "win32" ? it.skip : it; |
62 | 63 | |
@@ -763,7 +764,8 @@ describe("kitchen-sink RPC caller loading", () => {
|
763 | 764 | }); |
764 | 765 | |
765 | 766 | posixIt("kills descendants when timed commands exit cleanly after SIGTERM", async () => { |
766 | | -const root = mkdtempSync(path.join(tmpdir(), "openclaw-kitchen-rpc-timeout-clean-parent-")); |
| 767 | +const tempDirs: string[] = []; |
| 768 | +const root = makeTempDir(tempDirs, "openclaw-kitchen-rpc-timeout-clean-parent-"); |
767 | 769 | const scriptPath = path.join(root, "term-zero-grandchild.mjs"); |
768 | 770 | const grandchildPidPath = path.join(root, "grandchild.pid"); |
769 | 771 | let grandchildPid = 0; |
@@ -803,7 +805,7 @@ setInterval(() => {}, 1000);
|
803 | 805 | if (grandchildPid && isProcessAlive(grandchildPid)) { |
804 | 806 | process.kill(grandchildPid, "SIGKILL"); |
805 | 807 | } |
806 | | -rmSync(root, { recursive: true, force: true }); |
| 808 | +cleanupTempDirs(tempDirs); |
807 | 809 | } |
808 | 810 | }); |
809 | 811 | }); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。