tests: two read-only-file cases skip under root (TEST-ROOT-READONLY) #685
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!685
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/685/head"
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?
@hugo0024 on GitHub · 2026-11-24 11:57 UTC · original
hugo0024:test-root-readonly→main· +4 −0 · 2 files · 1 commits · merged 2026-11-24 13:09 UTCClaimed 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
mainat21625bc.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
@lixonik on GitHub · 2026-11-24 12:04 UTC · original · reviewed
Independent check from full Git worktrees at
21625bcaand4e4c2b15. On Windows,python -I -B tests/test_awc_manifest.py -vpassed 23/23 andpython -I -B tests/test_navmesh_nodes.py -vpassed 17/17 on both revisions. Both changed read-only cases ran and passed, with zero skips.On Linux under WSL, the base run as root failed exactly the two expected cases. The PR run as root skipped those two and passed the remaining 38. As an unprivileged user, all 40 passed on the PR with zero skips.
AI-assisted testing with synthetic fixtures. No GPU required.
@abnalstlll-byte on GitHub · 2026-11-24 12:18 UTC · original · approved these changes
Technical Review: APPROVE (TEST-ROOT-READONLY)
Root Cause & Correctness:
Clean-Room & Verification:
21625bca8(0 conflicts).LGTM!
@wanchudao on GitHub · 2026-11-24 15:39 UTC · original
Checked the Windows part of #685 after the merge, on main at
3d3770cwith Windows 11 Probuild 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.