test(FN-4786): stabilize cli tmp-dir tests for workspace runs

Fusion-Task-Id: FN-4786
Fusion-Task-Lineage: eb683ec8-8b9d-4e3d-852c-7076224afa6b
This commit is contained in:
Fusion (runfusion.ai)
2026-05-16 18:25:53 -07:00
committed by gsxdsm
parent ec169bf347
commit 825e5479f5
2 changed files with 3 additions and 3 deletions

View File

@@ -6,10 +6,10 @@ const CLI_PACKAGE_VERSION = (
JSON.parse(readFileSync(new URL("../../package.json", import.meta.url), "utf-8")) as { version: string }
).version;
const cacheDir = "/tmp/fusion-update-cache-test";
const cacheDir = `/tmp/fusion-update-cache-test-${process.pid}-${Date.now()}`;
const { mockResolveGlobalDir } = vi.hoisted(() => ({
mockResolveGlobalDir: vi.fn().mockReturnValue("/tmp/fusion-update-cache-test"),
mockResolveGlobalDir: vi.fn().mockReturnValue(cacheDir),
}));
vi.mock("@fusion/core", () => ({

View File

@@ -88,7 +88,7 @@ function restoreInternalPackageDistDirs() {
describe("vitest workspace temp dir cleanup", () => {
it("cleans stale workspace-resolution temp dirs without touching unrelated tmp dirs", () => {
const staleDir = join(workspaceRoot, `${hiddenDistRootPrefix}stale-test`);
const staleDir = join(workspaceRoot, `${hiddenDistRootPrefix}stale-test-${process.pid}-${Date.now()}`);
const staleMarker = join(staleDir, "marker.txt");
const unrelatedTmpDir = join(workspaceRoot, ".tmp-fn-other-marker-test");