Skip to content

Commit cb8cb24

Browse files
committed
test: skip tests failing when run under root
1 parent 57bc177 commit cb8cb24

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

test/parallel/test-fs-mkdtempDisposableSync.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ if (isMainThread) {
6868

6969
// Errors from cleanup are thrown
7070
// It is difficult to arrange for rmdir to fail on windows
71-
if (!common.isWindows) {
71+
if (!common.isWindows && process.getuid() !== 0) {
7272
const base = fs.mkdtempDisposableSync(tmpdir.resolve('foo.'));
7373

7474
// On Unix we can prevent removal by making the parent directory read-only

test/parallel/test-fs-promises-mkdtempDisposable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ async function chdirDoesNotAffectRemoval() {
6868

6969
async function errorsAreReThrown() {
7070
// It is difficult to arrange for rmdir to fail on windows
71-
if (common.isWindows) return;
71+
if (common.isWindows || process.getuid() === 0) return;
7272
const base = await fsPromises.mkdtempDisposable(tmpdir.resolve('foo.'));
7373

7474
// On Unix we can prevent removal by making the parent directory read-only

0 commit comments

Comments
 (0)