chore(axiom-pi): build the parity probe inside the try/finally

A setup failure (or a hard kill) would otherwise leave axiom-parity-probe-<pid>.swift
in the shared temp root — the junk class this suite exists to guard against, and
now harmless to the detector but still litter.
This commit is contained in:
Charles Wiltgen
2026-09-15 09:12:33 -07:00
parent f7b891d9d7
commit 02b8cea5c2
+3 -1
View File
@@ -467,9 +467,11 @@ describe("project detection parity with project_detect.py", () => {
fs.mkdirSync(path.join(tempRepo, ".git")); fs.mkdirSync(path.join(tempRepo, ".git"));
fs.mkdirSync(path.join(tempRepo, "ios", "App.xcodeproj"), { recursive: true }); fs.mkdirSync(path.join(tempRepo, "ios", "App.xcodeproj"), { recursive: true });
const tempProbe = path.join(os.tmpdir(), `axiom-parity-probe-${process.pid}.swift`); const tempProbe = path.join(os.tmpdir(), `axiom-parity-probe-${process.pid}.swift`);
fs.writeFileSync(tempProbe, "");
try { try {
// Created inside the try: a setup failure must not leave the probe behind in
// the shared temp root, which is the exact junk class this suite guards.
fs.writeFileSync(tempProbe, "");
const plain = dir("plain"); const plain = dir("plain");
const atCwd = dir("marker-at-cwd"); const atCwd = dir("marker-at-cwd");
file("marker-at-cwd", "Package.swift"); file("marker-at-cwd", "Package.swift");