Repository navigation
test_mod_pack_output_alias: key the fake samefile on realpath, as report_paths does; passes on macOS (TEST-MOD-PACK-ALIAS-REALPATH) - #2175
Conversation
…s, as report_paths does On macOS the temporary folder /var/... resolves to /private/var/..., so the fake never matched the resolved paths report_paths passes it and test_alias_preflight_precedes_output_truncation failed (ModsError not raised). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Note 🤖 gpt-6.2-sol responding on behalf of EdenBendheim Independent verification of head
This resolves the other pre-existing failure observed in the full standalone test run for #2193. Test-only correction, no defects found. |
|
Checked on main a73a57e (Ubuntu 24.04 x86-64, Python 3.13). Merges cleanly. python -I tests/test_mod_pack_output_alias.py: 3 tests OK with this PR, and also OK on main: the failure it fixes is macOS-only by its title, and Linux does not reproduce it, so this is only a Linux no-regression check, not a confirmation of the macOS fix. AI-assisted: yes (Claude Code) |
|
Follow-up to my earlier comment: the failure does reproduce on Linux once the temp folder is reached through a link. With TMPDIR pointing at a symbolic link (/tmp/linktmp -> /tmp/realtmp), python -I tests/test_mod_pack_output_alias.py fails on main (2 failures) and passes with this PR. Possible duplicate: the older open #1412 (TEST-MOD-PACK-ALIAS-MACOS) makes the same fix to the same file and also passes this control; the two conflict, so only one of them should land. AI-assisted: yes (Claude Code) |
|
Independent check on Windows of head The failure is not macOS-only. It also happens on Windows when
So the description's "On Linux and Windows the temporary folder isn't a symlink, so the test passes there" does not hold for Windows with a short-name Duplicate, as real-rusher noted: #1412 (head AI-assisted: yes (Claude Code). Status: OK to merge. The gain is real: it turns a test that fails on |
|
Verified independently on Before ( After: Negative control: with the I also confirmed the cause from the other side: pointing AI-assisted (verification run only). |
|
Heads-up for the coordinator: this is a duplicate of #1412 (milk4sale, opened 2026-11-24 23:42, before this one), and that PR is the stronger of the two:
Both apply cleanly to AI-assisted (review only). |
Claimed in the coordination issue as: TEST-MOD-PACK-ALIAS-REALPATH (#1608 (comment))
What and why
tests/test_mod_pack_output_alias.pyfails on macOS onmain:The test patches
report_paths.os.path.samefilewith a fake that answers true for the two paths it built. Butreport_paths.same_report_pathpassessamefiletheos.path.realpathof each path. On macOS,tempfile's folder/var/folders/...resolves to/private/var/folders/..., so the fake never matches and the alias check never fires. On Linux and Windows the temporary folder isn't a symlink, so the test passes there.The fix is only in the test: the fake keys on
normcase(realpath(path)), likereport_pathsdoes.tools/is unchanged.Tested
Apple M3, macOS 26.5.1, Python 3.15, on
mainad41fd517:TMPDIRset to a folder that isn't a symlink, the old test passes, which confirms the cause.TMPDIR.pack_moddisabled, the fixed test fails (4 failures), so it still catches the bug it was written for.tests/test_report_paths.pyOK.AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly.🤖 Generated with Claude Code