tests: two read-only-file cases skip under root (TEST-ROOT-READONLY) #685
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/685"
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?
Imported from ubiquitarianism/leonida. Originally posted by hugo0024 on 2026-11-24T11:57:52Z.
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
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
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-24T12:04:08Z.
Review: COMMENTED
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.
Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T12:18:25Z.
Review: APPROVED
Technical Review: APPROVE (TEST-ROOT-READONLY)
Root Cause & Correctness:
Clean-Room & Verification:
21625bca8(0 conflicts).LGTM!
Imported from ubiquitarianism/leonida. Originally posted by wanchudao on 2026-11-24T15:39:54Z.
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.