Skip to content

Commit 34cb10b

Browse files
test: skip tests failing when run under root
PR-URL: #59779 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Daeyeon Jeong <[email protected]>
1 parent 303677b commit 34cb10b

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)