diff --git a/tests/lib/session-aliases.test.js b/tests/lib/session-aliases.test.js index 8e4b7226..11a4fa05 100644 --- a/tests/lib/session-aliases.test.js +++ b/tests/lib/session-aliases.test.js @@ -1230,8 +1230,8 @@ function runTests() { // session-aliases.js lines 131-137: When saveAliases fails (outer catch), // it tries to restore from backup. If the restore ALSO fails, the inner // catch at line 135 logs restoreErr. No existing test creates this double-fault. - if (process.platform === 'win32') { - console.log(' (skipped — chmod not reliable on Windows)'); + if (process.platform === 'win32' || process.getuid?.() === 0) { + console.log(' (skipped — chmod ineffective on Windows/root)'); return; } const isoHome = path.join(os.tmpdir(), `ecc-r90-restore-fail-${Date.now()}`); diff --git a/tests/lib/session-manager.test.js b/tests/lib/session-manager.test.js index a34447d7..bdf16417 100644 --- a/tests/lib/session-manager.test.js +++ b/tests/lib/session-manager.test.js @@ -2071,9 +2071,9 @@ file.ts // ── Round 112: appendSessionContent with read-only file — returns false ── console.log('\nRound 112: appendSessionContent (read-only file):'); if (test('appendSessionContent returns false when file is read-only (EACCES)', () => { - if (process.platform === 'win32') { - // chmod doesn't work reliably on Windows — skip - assert.ok(true, 'Skipped on Windows'); + if (process.platform === 'win32' || process.getuid?.() === 0) { + // chmod ineffective on Windows/root — skip + assert.ok(true, 'Skipped on Windows/root'); return; } const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'r112-readonly-'));