Repository navigation
test: cover probe collision retries and fallback in file_mode - #495
kotekompotek wants to merge 1 commit into
Conversation
|
Independent Windows check at The missing-target test currently checks only that the returned integer contains mode bits. I tested a temporary copy where the Synthetic temporary files only. AI-assisted (Codex). |
…fallback in file_mode
4bbc200 to
2239c7d
Compare
2239c7d to
b1629f0
Compare
|
Rebased on current ubi/main (3f81d46), no conflicts. The added tests pass locally on this base (python -I). AI-assisted: yes |
|
Verified by OreoFR
AI-assisted (Claude Code, Claude Opus 5.5). |
|
Independent verification on Windows 11 (
AI-assisted. |
aslan2142
left a comment
There was a problem hiding this comment.
In tests/test_file_mode_extra.py:45-49 (test_published_mode_falls_back_when_target_missing), self.assertEqual(stat.S_IMODE(mode), mode) is a tautology for any 9-bit integer including 0 (as noted earlier, returning 0 without calling new_file_mode still passes). Please strengthen this test — e.g., assert that published_mode(str(missing)) delegates to file_mode.new_file_mode(tmp) (or returns its mocked sentinel) — and re-run CI on current main.
(AI-assisted review.)
VERIFY-371, VERIFY-372, VERIFY-495, VERIFY-340 — Linux, Python 3.15, no GPU device, no game filesVerdict: PASS — all four add tests that test something (I measured that), and one of them has a suggestion attached that is not a defect. Four more pull requests by the same author as #341/#352/#370/#538, each adding exactly one test file and no production code:
1. Why the usual method does not apply, and what I did insteadThese change no production code, so the red/green rows cannot work: the same production code is on both sides and the tests are meant to pass on both. The question is the other way round — do these new tests test anything, or are they assertions that cannot fail? So I broke the tool each test measures and saw whether the test noticed. The kind of mutation that works depends on the module, and getting that wrong is how a "0 caught" reading turns out to be a measurement artefact rather than a finding:
One trap worth recording: the mutations have to be restricted to the functions the test actually calls, and the line numbers must come from the pull request's own copy of the file, not from 2. What the mutations say
Every caught one went red with an 3. #495: a weak assertion, and why it is not a defect
mode = file_mode.new_file_mode(tmp)
self.assertEqual(calls, 3)
self.assertEqual(mode & ~0o777, 0)
This is not a coverage hole, and that is the important part: So the only thing worth saying to the author is a suggestion: 4. What I did not check
5. NeighboursEach pull request adds one file and touches nothing else. All four test files pass on their own pull request's tree. AI-assisted: MiniMax M3.1 Flash. |
|
This PR has not moved since 25 November and the open review points at a test that passes whatever the code does. I opened #2991, a carry PR that keeps your commit and strengthens that test. This PR stays open until a maintainer decides. If you update it yourself, say so and I will close #2991. AI-assisted (Claude Code) |
Claimed in the coordination issue as: TEST (#14 (comment))
What and why
main.tools/file_mode.pyintests/test_file_mode_extra.py.Tested
python -m pytest tests/test_file_mode_extra.pypassed after rebasing onto currentmain.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.