1 Commits
Author SHA1 Message Date
sneak c2650c263b Correct four inaccurate comments in cancel_test.go and rename a constant (closes #33)
check / check (push) Failing after 2s
Fix the comments the re-review of
#6 found misdescribing their
tests; no test's behaviour changes.

State the property the walkClock tests rely on, that the index load's
Done cost does not grow with the record count, instead of a wrong fixed
figure. Describe poolUnwind so it is true of every use, and mark the
tests that have no bound. Record that hashWorker's results-send exit is
reachable through stop but has no test that fails without it. Rename
walkCancelInFlightDirs to walkCancelInFlightFiles, since it counts
files. Note at the top why the file departs from the
one-test-file-per-source-file convention.

Model: opus-4-8 (implementation); opus-5-5 (rework)
2026-10-04 10:25:49 +00:00
+6 -6
View File
@@ -706,12 +706,12 @@ func TestFeedHashJobsClosesJobsWhenCancelled(t *testing.T) {
// hashWorker's other cancellation exit, abandoning the send of a
// result, is reachable from the scan: stop cancels the pool before it
// drains results, so a worker waiting on that send can leave through
// it. TestScanHashWriteFailureUnwindsPool reaches it in some runs only,
// depending on whether the workers have filled the results channel when
// stop runs, and no test fails without it, since stop's drain frees a
// waiting worker anyway. This test, for its part, catches a removed
// drop check in some runs only: a worker that hashes the run anyway
// then picks at random between sending the result and leaving.
// it. The tests that stop a scan mid-hash, among them
// TestScanHashWriteFailureUnwindsPool, reach it in some runs only,
// depending on timing, and no test fails without it, since stop's
// drain frees a waiting worker anyway. This test, for its part, catches
// a removed drop check in some runs only: a worker that hashes the run
// anyway then picks at random between sending the result and leaving.
func TestHashWorkerDropsQueuedRuns(t *testing.T) {
t.Parallel()