mirror of
https://github.com/denoland/std.git
synced 2024-11-21 20:50:22 +00:00
test(fs): check ensureDir()
is not racy (#5086)
This commit is contained in:
parent
41a2da4788
commit
ec27c49cbf
@ -187,3 +187,22 @@ Deno.test({
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
name: "ensureDir() isn't racy",
|
||||
async fn() {
|
||||
for (const _ of Array(100)) {
|
||||
const dir = path.join(
|
||||
await Deno.makeTempDir(),
|
||||
"check",
|
||||
"race",
|
||||
);
|
||||
|
||||
// It doesn't throw with successive calls.
|
||||
await Promise.all([
|
||||
ensureDir(dir),
|
||||
ensureDir(dir),
|
||||
]);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user