Repository navigation
Conversation
The old assertion (S_IMODE(mode) == mode) passes for any 9-bit integer, even 0. The test now mocks new_file_mode, checks the target's own directory is probed and the sentinel is returned, and a second test checks an existing file keeps its mode. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
At 7d05a02, all four new tests pass on Windows even if the probe name is generated once before the retry loop. With that change a real collision exhausts the retries on the same file. The mocked open succeeds on its third call regardless of the path. Could the retry-success test pre-create the first probe with sentinel bytes and patch secrets.token_hex to return two distinct names in order? With real os.open, the current implementation returned 0o666, preserved the sentinel, and removed the second probe. Moving name generation outside the loop raised FileExistsError and requested only one name. This would make the test catch the regression. Codex-assisted. |
The mocked open succeeded on its third call whatever the path, so generating the probe name once before the loop still passed. The test now pre-creates the first probe, patches secrets.token_hex with two names and keeps the real os.open. Reported by andrew-ai on the carry PR. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Thanks, that is a real gap. New head: the retry test now pre-creates the first probe ( AI-assisted (Claude Code) |
|
Rechecked facd4fb on Windows. All four tests passed. Moving name generation above the retry loop now fails the revised collision test with FileExistsError, which the earlier test missed. My original finding is resolved. Codex-assisted. |
Claimed in the coordination issue as: TEST (the claim of the original author, #14 (comment))
What and why
Carry of #495 (kotekompotek), unchanged since 25 November. This branch is
mainplus the head of #495 (the author's commit is kept), and one commit of mine that answers the two reviews on #495 (aslan2142, Dezmonius).The reviews found that
test_published_mode_falls_back_when_target_missingassertedS_IMODE(mode) == mode, which holds for any 9-bit integer, so the test passed even when the fallback returned0. It now mocksnew_file_mode, checks that the target's own directory is probed and that the sentinel comes back. A second test checks that an existing file keeps its own mode and does not probe.Tested
Windows 11, no GPU, no game files, on
main1abef08d0plus this branch:python -I tests/test_file_mode_extra.py: 4 tests OK.published_modechanged to return0onFileNotFoundError,test_published_mode_falls_back_when_target_missingfails (1 failure); restored afterwards.python -I tests/test_file_mode.py: OK (2 skipped).python -I scripts/check_no_game_data.pyon the changed file: clean.GPUs tested: n/a (unit tests only)
AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly.docs/design.md. (n/a: tests only)Supersedes #495 once merged; the original stays open until a maintainer decides.
AI-assisted (Claude Code)
🤖 Generated with Claude Code