0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-29 08:58:01 -04:00

Fix race condition in chmod test

This commit is contained in:
Ryan Dahl 2018-10-27 10:33:01 -04:00
parent 6adc87e3eb
commit 50d6593f6a

View file

@ -31,10 +31,10 @@ if (isNotWindows) {
const filename = tempDir + "/test.txt"; const filename = tempDir + "/test.txt";
deno.writeFileSync(filename, data, 0o666); deno.writeFileSync(filename, data, 0o666);
const symlinkName = tempDir + "/test_symlink.txt"; const symlinkName = tempDir + "/test_symlink.txt";
deno.symlink(filename, symlinkName); deno.symlinkSync(filename, symlinkName);
let symlinkInfo = deno.lstatSync(symlinkName); let symlinkInfo = deno.lstatSync(symlinkName);
const symlinkMode = symlinkInfo.mode & 0o777; // plaform dependent const symlinkMode = symlinkInfo.mode & 0o777; // platform dependent
deno.chmodSync(symlinkName, 0o777); deno.chmodSync(symlinkName, 0o777);
@ -96,10 +96,10 @@ if (isNotWindows) {
const filename = tempDir + "/test.txt"; const filename = tempDir + "/test.txt";
deno.writeFileSync(filename, data, 0o666); deno.writeFileSync(filename, data, 0o666);
const symlinkName = tempDir + "/test_symlink.txt"; const symlinkName = tempDir + "/test_symlink.txt";
deno.symlink(filename, symlinkName); deno.symlinkSync(filename, symlinkName);
let symlinkInfo = deno.lstatSync(symlinkName); let symlinkInfo = deno.lstatSync(symlinkName);
const symlinkMode = symlinkInfo.mode & 0o777; // plaform dependent const symlinkMode = symlinkInfo.mode & 0o777; // platform dependent
await deno.chmod(symlinkName, 0o777); await deno.chmod(symlinkName, 0o777);