diff --git a/test/parallel/test-config-file.js b/test/parallel/test-config-file.js index 0e67d12f09a..ea134ce1751 100644 --- a/test/parallel/test-config-file.js +++ b/test/parallel/test-config-file.js @@ -361,7 +361,10 @@ test('should override node.config.json when specificied', async () => { strictEqual(result.code, 0); }); // Skip on windows because it doesn't support chmod changing read permissions -test('should throw an error when the file is non readable', { skip: common.isWindows }, async () => { +// Also skip if user is root because it would have read permissions anyway +test('should throw an error when the file is non readable', { + skip: common.isWindows || process.getuid() === 0, +}, async () => { chmodSync(fixtures.path('rc/non-readable/node.config.json'), constants.O_RDONLY); const result = await spawnPromisified(process.execPath, [ '--no-warnings', diff --git a/test/parallel/test-sqlite-backup.mjs b/test/parallel/test-sqlite-backup.mjs index eba7aaf610a..51955547964 100644 --- a/test/parallel/test-sqlite-backup.mjs +++ b/test/parallel/test-sqlite-backup.mjs @@ -1,4 +1,4 @@ -import { skipIfSQLiteMissing } from '../common/index.mjs'; +import { isWindows, skipIfSQLiteMissing } from '../common/index.mjs'; import tmpdir from '../common/tmpdir.js'; import { join } from 'node:path'; import { describe, test } from 'node:test'; @@ -7,6 +7,8 @@ import { pathToFileURL } from 'node:url'; skipIfSQLiteMissing(); const { backup, DatabaseSync } = await import('node:sqlite'); +const isRoot = !isWindows && process.getuid() === 0; + let cnt = 0; tmpdir.refresh(); @@ -252,7 +254,7 @@ test('throws if URL is not file: scheme', (t) => { }); }); -test('database backup fails when dest file is not writable', async (t) => { +test('database backup fails when dest file is not writable', { skip: isRoot }, async (t) => { const readonlyDestDb = nextDb(); writeFileSync(readonlyDestDb, '', { mode: 0o444 });