test(tools): preserve loop coverage without symlink privileges #15652
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15652"
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 boykopovar/AnyPS5. Originally posted by Matt10n3 on 2026-11-03T23:59:04Z.
What
On Windows without symbolic-link privilege, the registration and missing-command recovery loop regressions fail during fixture setup with WinError 1314. Add deterministic Path.resolve loop fixtures that run without privileges, while retaining real directory-symlink-cycle integration cases on capable hosts. Only unsupported link setup (NotImplementedError or Windows error 1314) produces an explicit integration-test skip; scanner errors and other OSErrors still fail.
Visit the loop before the valid sibling, so both regressions detect stopping the scan early as well as failing to suppress a loop exception. No production code, PS5 behavior, dependency or OS security-policy changes.
This branch is based directly on main and contains no AppContent overflow changes.
Tested
test_test_registration.py -vran 78 tests: 77 passed and one real-symlink integration case skipped for WinError 1314.test_select_tests.py MissingCommandTests -vran four tests: three passed and one such case skipped. Both mocked loop regressions executed.cmake --build C:\temp\anyps5-registration\build --parallel 8succeeded. Full CTest: 677/677 passed in 93.73 s, including the registration and missing-command cases.guest_libc_cnd_timed_wait(abort0xc0000409, reproduced in isolation): 807 passed, one skipped, one failed and 2,911 not run. This tools-only change did not affect that run, and the full-runtime suite was not rerun on this base.check_conventions.py --base origin/mainpassed.pr_overlap.pychecked 1,816 open PRs and reported no overlap.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-11-04T01:24:52Z.
Review: APPROVED
@Matt10n3 thanks, this fixes a failure I see on this machine. Without the symlink privilege,
main'stest_looping_subdirectory_is_skippederrors with[WinError 1314] A required privilege is not held by the clientin fixture setup. The mocked fixtures reach theexcept RuntimeError: continuein both tools (tools/check_test_registration.py:165,tools/select_tests.py:115). Withsubdirs("nested" "first"),pending.pop()(tools/check_test_registration.py:164,tools/select_tests.py:114) takes the loop first, so stopping the scan early would be caught as well.What I ran: head
c0d7bc2ecamerged ontomain1c8c0efc8c, Windows 11, Python 3.14.7, no symlink privilege:main:test_test_registration.py77 tests,FAILED (errors=1);test_select_tests.py MissingCommandTests3 tests,FAILED (errors=1), both WinError 1314;test_test_registration.py78 tests, OK (skipped=1);test_select_tests.py50 tests, OK (skipped=1). The skips are the two real-symlink cases, for WinError 1314;except RuntimeError:changed toexcept ZeroDivisionError:in both tools:test_test_registration.pyFAILED (errors=2, skipped=1)andMissingCommandTestsFAILED (errors=2, skipped=1), both from the new mocked tests' two subtests;tools/check_conventions.py --base upstream/main: all checks passed.tools/pr_overlap.py --branchon the head against the 1,829 open pull requests: "No overlap with open pull requests."Optional, not for this PR: since Python 3.13,
Path.resolve()no longer raisesRuntimeErroron a symlink loop: it raisesOSErrorin strict mode and nothing otherwise (pathlib docs, "Changed in version 3.13"). On 3.13+ theexcept RuntimeErrorin both tools is reached only through the mock, and a real loop is presumably handled by thevisitedset instead. I haven't checked that on a host with the privilege.Approving.
Imported from boykopovar/AnyPS5. Originally posted by Superseabas on 2026-11-04T16:52:53Z.
Review: APPROVED
Second Windows machine without the symbolic-link privilege (standard user, Developer Mode off). Head
c0d7bc2ecamerged onto currentmainb11c7bf84f(clean merge, local only), Python 3.13,ctest, 3 runs each:maintest_registration[WinError 1314]atos.symlink)select_tests_MissingCommandTestsVerbose, on the merge:
test_looping_subdirectory_is_skippedandtest_looping_subdirectory_is_skipped_when_recovering_commandsrun and pass with the mocked loop. The two..._where_supportedcases skip withsymbolic link privilege is unavailable: [WinError 1314] ….test_test_registrationran 78 tests (OK, skipped=1) andMissingCommandTestsran 4 tests (OK, skipped=1).check_conventions.py --base mainpasses.AI-assisted: yes (Claude Code)