tests: two read-only-file cases skip under root (TEST-ROOT-READONLY) #685
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!685
Loading…
Reference in a new issue
No description provided.
Delete branch "test-root-readonly"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pull request successfully merged and closed
Claimed in the coordination issue as: TEST-ROOT-READONLY
What and why
Two test cases make a file read-only (
0o444) and expect the write to be refused:tests/test_awc_manifest.py:ManifestTest.test_read_only_manifest_is_refused_without_staging_a_filetests/test_navmesh_nodes.py:ArchiveTest.test_cli_refuses_an_unwritable_out_before_the_archives_are_readRoot ignores the file mode, so the write succeeds and both files are red whenever the tests run as root, the default user in most containers. The tools are right; the tests cannot set up their precondition.
Both cases now skip under POSIX root, with the check and the reason
tests/test_image_query_probe.pyandtests/test_mode_round_probe.pyalready use (root bypasses read-only file mode). Windows and a non-root POSIX user still run them.In a full run of the standard-library loop as root, these were the only two cases that failed for this reason.
Tested
Ubuntu 24.04, Python 3.13.18, on
mainat 21625bc.python -I tests/test_awc_manifest.pypython -I tests/test_navmesh_nodes.pyrunuser -u nobody), each of the two cases was also run by name with-vand passes.python -m compileall -q make_game.py tools testspasses, and so doespython -I scripts/check_no_game_data.pyon the two files.stdlib-tests-linuxjob, as root, after the change: 478 files, 2 failing (tests/test_tool_stdout_encoding.pyandtests/test_ttpf_assets.py). Both fail the same way with this change reverted, and neither reads the files changed here.GPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code
https://claude.ai/code/session_01Lts24qp68LkwdoVemtts4A
Technical Review: APPROVE (TEST-ROOT-READONLY)
Root Cause & Correctness:
Clean-Room & Verification:
LGTM!
Checked the Windows part of #685 after the merge, on main at 3d3770c with Windows 11 Pro
build 26300 and Python 3.14.7. To repeat the verbose checks:
python -I tests/test_awc_manifest.py -v— 23 tests, with 21 passing and 2 skipped.test_read_only_manifest_is_refused_without_staging_a_filepassed.python -I tests/test_navmesh_nodes.py -v— 17 passed.test_cli_refuses_an_unwritable_out_before_the_archives_are_readpassed.Both read-only tests ran with the POSIX-root guard present. The two AWC skips were
symlink tests, which returned WinError 1314 (the account lacked the required
privilege). This run covered Windows only.
AI use — DeepSeek Harness (DeepSeek V4.1 Flash) ran the tests and drafted the report.
OpenAI Codex (GPT-6.2 Sol) checked the archived results and revised the report.