Give the fs corpus programs per-process scratch directories

5568-fs-cp-errors built its fixture in a /tmp directory named after the
program file, which it deletes and recreates. The Node oracle and the
native runs of one program run at the same time, so two runs with the
same name deleted each other's files and the program exited 1 on
random shards. Its root, and that of the five other corpus programs
that name a /tmp/scr-* directory after the program file alone, now
ends in the process id, as 5571-fs-cp-deep's does.
This commit is contained in:
Chris Tate
2026-10-21 15:54:23 -05:00
parent 621b7cfe58
commit 47671d5bed
6 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ function tail(path: string): string {
}
return path.slice(i + 1);
}
const dir = `/tmp/scr-dirent-${tail(process.argv[1] === undefined ? "x" : process.argv[1])}`;
const dir = `/tmp/scr-dirent-${tail(process.argv[1] === undefined ? "x" : process.argv[1])}-${process.pid}`;
if (fs.existsSync(dir)) fs.rmSync(dir, { recursive: true, force: true });
fs.mkdirSync(dir);
fs.mkdirSync(`${dir}/sub-a`);
+1 -1
View File
@@ -9,7 +9,7 @@ function tail(path) {
while (i >= 0 && path.charAt(i) !== "/" && path.charAt(i) !== "\\") i = i - 1;
return path.slice(i + 1);
}
const dir = `/tmp/scr-dirent-untyped-${tail(process.argv[1] === undefined ? "x" : process.argv[1])}`;
const dir = `/tmp/scr-dirent-untyped-${tail(process.argv[1] === undefined ? "x" : process.argv[1])}-${process.pid}`;
if (fs.existsSync(dir)) fs.rmSync(dir, { recursive: true, force: true });
fs.mkdirSync(`${dir}/sub`, { recursive: true });
fs.writeFileSync(`${dir}/a.txt`, "x");
+1 -1
View File
@@ -8,7 +8,7 @@ function tail(path: string): string {
while (i >= 0 && path.charAt(i) !== "/" && path.charAt(i) !== "\\") i = i - 1;
return path.slice(i + 1);
}
const root = `/tmp/scr-cpsync-${tail(process.argv[1] === undefined ? "x" : process.argv[1])}`;
const root = `/tmp/scr-cpsync-${tail(process.argv[1] === undefined ? "x" : process.argv[1])}-${process.pid}`;
if (fs.existsSync(root)) fs.rmSync(root, { recursive: true, force: true });
fs.mkdirSync(root);
const home = process.cwd();
+1 -1
View File
@@ -11,7 +11,7 @@ function tail(path) {
while (i >= 0 && path.charAt(i) !== "/" && path.charAt(i) !== "\\") i = i - 1;
return path.slice(i + 1);
}
const root = `/tmp/scr-cp-errors-${tail(process.argv[1] === undefined ? "x" : process.argv[1])}`;
const root = `/tmp/scr-cp-errors-${tail(process.argv[1] === undefined ? "x" : process.argv[1])}-${process.pid}`;
if (fs.existsSync(root)) fs.rmSync(root, { recursive: true, force: true });
fs.mkdirSync(root);
const home = process.cwd();
+1 -1
View File
@@ -9,7 +9,7 @@ function tail(path: string): string {
while (i >= 0 && path.charAt(i) !== "/" && path.charAt(i) !== "\\") i = i - 1;
return path.slice(i + 1);
}
const root = `/tmp/scr-cp-links-${tail(process.argv[1] === undefined ? "x" : process.argv[1])}`;
const root = `/tmp/scr-cp-links-${tail(process.argv[1] === undefined ? "x" : process.argv[1])}-${process.pid}`;
if (fs.existsSync(root)) fs.rmSync(root, { recursive: true, force: true });
fs.mkdirSync(root);
const home = process.cwd();
+1 -1
View File
@@ -9,7 +9,7 @@ function tail(path: string): string {
while (i >= 0 && path.charAt(i) !== "/" && path.charAt(i) !== "\\") i = i - 1;
return path.slice(i + 1);
}
const root = `/tmp/scr-cp-async-${tail(process.argv[1] === undefined ? "x" : process.argv[1])}`;
const root = `/tmp/scr-cp-async-${tail(process.argv[1] === undefined ? "x" : process.argv[1])}-${process.pid}`;
if (fs.existsSync(root)) fs.rmSync(root, { recursive: true, force: true });
fs.mkdirSync(root);
const home = process.cwd();