Two cancellation checks in the scan's directory walk in scan.go have
no test that fails without them:
walkOneDir stops reading a directory once the scan is cancelled
(the ctx.Err() check at the top of its entry loop, added by #5).
startWalkWorkers drops the directories still queued once the scan
is cancelled (the ctx.Err() check before walkOneDir).
Removing either one, each on its own, leaves make test passing. TestWalkWorkersDropQueuedDirs was written for the second, but the
first now hides it: a worker that walks a queued directory on a
cancelled scan reads its entries and stops before emitting anything,
so the test still sees no events. TestSyncScanCancelledMidWalkKeepsRecords
allows every directory in flight to emit all its files after the
cancellation, so its bound does not notice the first.
Two cancellation checks in the scan's directory walk in `scan.go` have
no test that fails without them:
- `walkOneDir` stops reading a directory once the scan is cancelled
(the `ctx.Err()` check at the top of its entry loop, added by
https://git.eeqj.de/sneak/sfdupes/issues/5).
- `startWalkWorkers` drops the directories still queued once the scan
is cancelled (the `ctx.Err()` check before `walkOneDir`).
Removing either one, each on its own, leaves `make test` passing.
`TestWalkWorkersDropQueuedDirs` was written for the second, but the
first now hides it: a worker that walks a queued directory on a
cancelled scan reads its entries and stops before emitting anything,
so the test still sees no events. `TestSyncScanCancelledMidWalkKeepsRecords`
allows every directory in flight to emit all its files after the
cancellation, so its bound does not notice the first.
Found while reworking https://git.eeqj.de/sneak/sfdupes/pulls/59.
## Definition of done
A test fails when either check is removed.
Model: opus-5-5
clawbot
added this to the 1.0.0 milestone 2026-10-04 11:54:40 +02:00
Each of the two walk cancellation checks now has a test that fails without it; scan.go is unchanged: #85
Model: opus-5-5
Each of the two walk cancellation checks now has a test that fails without it; `scan.go` is unchanged: https://git.eeqj.de/sneak/sfdupes/pulls/85
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.
Two cancellation checks in the scan's directory walk in
scan.gohaveno test that fails without them:
walkOneDirstops reading a directory once the scan is cancelled(the
ctx.Err()check at the top of its entry loop, added by#5).
startWalkWorkersdrops the directories still queued once the scanis cancelled (the
ctx.Err()check beforewalkOneDir).Removing either one, each on its own, leaves
make testpassing.TestWalkWorkersDropQueuedDirswas written for the second, but thefirst now hides it: a worker that walks a queued directory on a
cancelled scan reads its entries and stops before emitting anything,
so the test still sees no events.
TestSyncScanCancelledMidWalkKeepsRecordsallows every directory in flight to emit all its files after the
cancellation, so its bound does not notice the first.
Found while reworking #59.
Definition of done
A test fails when either check is removed.
Model: opus-5-5
Each of the two walk cancellation checks now has a test that fails without it;
scan.gois unchanged: #85Model: opus-5-5