Test both hashWorker cancellation checks on their own (closes #83)
check / check (push) Failing after 1s

TestHashWorkerDropsQueuedRuns now passes hashWorker a hash function
that only records being called, so a worker that hashes a run after
the scan is cancelled fails the test every time instead of only when
it then chose to send its result.

TestHashWorkerAbandonsBlockedSend cancels the scan from inside the
hash function and leaves the result channel unread, so the worker can
only return through the cancellation case beside its send. The scan
tests could not show this, because stop drains results and frees a
parked worker anyway.

Model: opus-5-5
This commit is contained in:
2026-10-04 12:12:32 +00:00
parent 7278c354f0
commit 8222000c97
2 changed files with 55 additions and 22 deletions
+3
View File
@@ -29,6 +29,9 @@
# Completed Steps
- a test fails when either `hashWorker` cancellation check in `scan.go`
is removed (2026-10-04, https://git.eeqj.de/sneak/sfdupes/issues/83)
- a test fails when either walk cancellation check in `scan.go` is
removed (2026-10-04, https://git.eeqj.de/sneak/sfdupes/issues/81)