fix(test-e2e-playwright): create the tor reader lock owner-only

py/overly-permissive-file on PR #625 (run_parallel.py:287): tor.lock was created 0o644; the scheduler and wait_onion_reachable.sh both run as root under become. The new test sets umask 0 and fails at 0o644.

🎯 Fix: 95 %
💥 Break: 3 %
💸 Cost: –
⏱️ Time: –
🛡️ Security: ~100 %
🏆 Score: 92
🚦 Gate: ✅ 90/5, cost and time <= 100, security 100 %

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
kevinveenbirkenbachandClaude Opus 5.5 committed 2026-11-05 17:03:10 +00:00
1 parent 8c199a915d
commit ae9907df81
2 files changed
+14 -1

No files matched your search

@@ -4,6 +4,7 @@ import itertools
import json
import os
import signal
import stat
import subprocess
import sys
import tempfile
@@ -567,6 +568,18 @@ class TestRun(unittest.TestCase):
self.assertGreaterEqual(self._stamps("start", "onion")[0], cleared)
class TestTorReaders(unittest.TestCase):
def test_the_lock_it_creates_is_open_to_its_owner_only_whatever_the_umask(self):
tmp = tempfile.TemporaryDirectory(prefix="tor_readers_")
self.addCleanup(tmp.cleanup)
lock = Path(tmp.name) / "tor.lock"
readers = rp.TorReaders(lock, 1)
self.addCleanup(os.umask, os.umask(0))
self.assertTrue(readers.acquire("onion", 1))
readers.release("onion")
self.assertEqual(0o600, stat.S_IMODE(lock.stat().st_mode))
class TestRunSignals(unittest.TestCase):
def test_retries_flaky_tests_and_crashed_pages_are_counted(self):
output = (