Skip to content

Commit 37783c3

Browse files
committed
test(qa): keep plugin lifecycle probe runtime-only
1 parent 23b5d58 commit 37783c3

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

test/e2e/qa-lab/plugins/plugin-lifecycle-probe-runtime.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,24 @@ import os from "node:os";
66
import path from "node:path";
77
import { readPluginInstallRecords } from "../../../../scripts/e2e/lib/plugin-index-sqlite.mjs";
88
import { resolveWindowsTaskkillPath } from "../../../../scripts/lib/windows-taskkill.mjs";
9-
import { createTempDirTracker } from "../../../helpers/temp-dir.js";
109

11-
const tempDirs = createTempDirTracker();
10+
// The Docker entrypoint runs without Vitest installed, so keep cleanup local to this runtime probe.
11+
const tempDirs = (() => {
12+
const dirs = new Set<string>();
13+
return {
14+
make(prefix: string): string {
15+
const dir = fs.mkdtempSync(path.join(os.tmpdir(), prefix));
16+
dirs.add(dir);
17+
return dir;
18+
},
19+
cleanup(): void {
20+
for (const dir of dirs) {
21+
fs.rmSync(dir, { recursive: true, force: true, maxRetries: 5, retryDelay: 20 });
22+
}
23+
dirs.clear();
24+
},
25+
};
26+
})();
1227

1328
type ProbeEnv = Pick<NodeJS.ProcessEnv, "HOME" | "OPENCLAW_CONFIG_PATH" | "OPENCLAW_STATE_DIR">;
1429

0 commit comments

Comments
 (0)