Removing either walk cancellation check in scan.go used to leave the tests passing (#81). Now each removal fails a test of its own; scan.go is unchanged.
TestWalkOneDirStopsWhenCancelled (new) calls walkOneDir on a cancelled scan for a directory holding one subdirectory. Without the check at the top of its entry loop, it returns that subdirectory to descend into.
TestWalkWorkersDropQueuedDirs now queues a directory that does not exist. Before, it queued a real one, and walkOneDir's own check stopped at the first entry, so a worker that walked it still emitted nothing. A missing directory fails to read before that check is reached, and the worker sends a warning.
What a reader would trip over: on a cancelled scan each send picks at random between delivering and giving up. So in the worker test one queued job catches the regression only half the time. With 64 queued, the chance of a regression passing is one in 2^64. The walkOneDir test does not depend on chance: returning the subdirectory is not a send.
Judgement call: the worker test rests on that one in 2^64 rather than on certainty. Everything a cancelled worker produces goes through such a send, so certainty would need a test-only context whose cancellation state contradicts itself.
Model: opus-5-5
Removing either walk cancellation check in `scan.go` used to leave the tests passing (https://git.eeqj.de/sneak/sfdupes/issues/81). Now each removal fails a test of its own; `scan.go` is unchanged.
- `TestWalkOneDirStopsWhenCancelled` (new) calls `walkOneDir` on a cancelled scan for a directory holding one subdirectory. Without the check at the top of its entry loop, it returns that subdirectory to descend into.
- `TestWalkWorkersDropQueuedDirs` now queues a directory that does not exist. Before, it queued a real one, and `walkOneDir`'s own check stopped at the first entry, so a worker that walked it still emitted nothing. A missing directory fails to read before that check is reached, and the worker sends a warning.
What a reader would trip over: on a cancelled scan each send picks at random between delivering and giving up. So in the worker test one queued job catches the regression only half the time. With 64 queued, the chance of a regression passing is one in 2^64. The `walkOneDir` test does not depend on chance: returning the subdirectory is not a send.
Judgement call: the worker test rests on that one in 2^64 rather than on certainty. Everything a cancelled worker produces goes through such a send, so certainty would need a test-only context whose cancellation state contradicts itself.
Model: opus-5-5
walkOneDir's check was hiding the worker's: a worker that walked a
queued directory on a cancelled scan still emitted nothing, because
walkOneDir stopped at its first entry. The worker test now queues a
missing directory, whose read fails and sends a warning before
walkOneDir's check is reached. A new test calls walkOneDir directly on
a cancelled scan and checks it returns no subdirectory to descend into.
Model: opus-5-5
Rebased onto next (now on top of the fix for #64).
TODO.md: both PRs added an entry at the top of Completed Steps. Kept both, with this PR's #81 entry first and the #64 entry right below it.
cancel_test.go applied without conflict and is unchanged.
Model: opus-5-5
Rebased onto `next` (now on top of the fix for https://git.eeqj.de/sneak/sfdupes/issues/64).
- `TODO.md`: both PRs added an entry at the top of Completed Steps. Kept both, with this PR's https://git.eeqj.de/sneak/sfdupes/issues/81 entry first and the https://git.eeqj.de/sneak/sfdupes/issues/64 entry right below it.
`cancel_test.go` applied without conflict and is unchanged.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Removing either walk cancellation check in
scan.goused to leave the tests passing (#81). Now each removal fails a test of its own;scan.gois unchanged.TestWalkOneDirStopsWhenCancelled(new) callswalkOneDiron a cancelled scan for a directory holding one subdirectory. Without the check at the top of its entry loop, it returns that subdirectory to descend into.TestWalkWorkersDropQueuedDirsnow queues a directory that does not exist. Before, it queued a real one, andwalkOneDir's own check stopped at the first entry, so a worker that walked it still emitted nothing. A missing directory fails to read before that check is reached, and the worker sends a warning.What a reader would trip over: on a cancelled scan each send picks at random between delivering and giving up. So in the worker test one queued job catches the regression only half the time. With 64 queued, the chance of a regression passing is one in 2^64. The
walkOneDirtest does not depend on chance: returning the subdirectory is not a send.Judgement call: the worker test rests on that one in 2^64 rather than on certainty. Everything a cancelled worker produces goes through such a send, so certainty would need a test-only context whose cancellation state contradicts itself.
Model: opus-5-5
Review passed; needs a rebase onto next only.
Model: opus-5-5
1a004e8dbbtof536c44042Rebased onto
next(now on top of the fix for #64).TODO.md: both PRs added an entry at the top of Completed Steps. Kept both, with this PR's #81 entry first and the #64 entry right below it.cancel_test.goapplied without conflict and is unchanged.Model: opus-5-5