Correct four inaccurate comments in cancel_test.go and rename a constant (closes #33) #59

Merged
clawbot merged 1 commits from issue-33-cancel-test-comments into next 2026-10-04 13:01:32 +02:00
Collaborator

Fixes the comments the re-review of
#6 found wrong. Only comments
and one constant's name in cancel_test.go change, plus TODO.md.

  • walkClock states the property the tests rely on (the index load's
    Done cost does not grow with the record count) instead of the wrong
    "three consultations" figure.
  • poolUnwind is described so it is true of every use, the SIGTERM
    test's included; three tests note that they have no such bound.
  • hashWorker's results-send exit is reachable through stop(), but no
    test fails without it, and TestHashWorkerDropsQueuedRuns catches a
    removed drop check in some runs only; the comment says so. Missing
    tests: #83.
  • walkCancelInFlightDirs held a file count; renamed
    walkCancelInFlightFiles, same value.
  • A top-of-file comment records the deliberate departure from the
    one-test-file-per-source-file convention.

Not visible in the diff: next has since gained mid-hash cancellation
tests and a per-entry cancellation check in the directory walk, so the
walkClock comment covers cancelling inside the hash phase and the
in-flight constant is an upper bound.

Mutation re-check repeated on the rebased tree: removing any one of the
walk and hash-pool cancellation branches in scan.go fails
make test, except the walk's two checks (#81) and
hashWorker's two (#83).

Model: opus-4-8 (implementation); opus-5-5 (rework)

Fixes the comments the re-review of https://git.eeqj.de/sneak/sfdupes/issues/6 found wrong. Only comments and one constant's name in `cancel_test.go` change, plus `TODO.md`. - `walkClock` states the property the tests rely on (the index load's Done cost does not grow with the record count) instead of the wrong "three consultations" figure. - `poolUnwind` is described so it is true of every use, the `SIGTERM` test's included; three tests note that they have no such bound. - `hashWorker`'s results-send exit is reachable through `stop()`, but no test fails without it, and `TestHashWorkerDropsQueuedRuns` catches a removed drop check in some runs only; the comment says so. Missing tests: https://git.eeqj.de/sneak/sfdupes/issues/83. - `walkCancelInFlightDirs` held a file count; renamed `walkCancelInFlightFiles`, same value. - A top-of-file comment records the deliberate departure from the one-test-file-per-source-file convention. Not visible in the diff: `next` has since gained mid-hash cancellation tests and a per-entry cancellation check in the directory walk, so the `walkClock` comment covers cancelling inside the hash phase and the in-flight constant is an upper bound. Mutation re-check repeated on the rebased tree: removing any one of the walk and hash-pool cancellation branches in `scan.go` fails `make test`, except the walk's two checks (https://git.eeqj.de/sneak/sfdupes/issues/81) and `hashWorker`'s two (https://git.eeqj.de/sneak/sfdupes/issues/83). Model: opus-4-8 (implementation); opus-5-5 (rework)
clawbot added the needs-review label 2026-09-21 09:44:57 +02:00
clawbot self-assigned this 2026-09-21 09:44:57 +02:00
Author
Collaborator

The comment corrections are accurate and in scope: verified against
scan.go that hashWorker's results-send branch is reachable and that
stop() cancels before draining, the walkClock and poolUnwind
claims hold, and the constant rename is complete with its value
unchanged. Three policy defects block merge.

  1. The commit message body contains a bare #6 ("re-review of #6").
    Bare issue references are not allowed outside the required
    (closes #N) title suffix. Acceptable: the full URL
    https://git.eeqj.de/sneak/sfdupes/issues/6.

  2. The new TODO.md Completed Steps entry is four physical lines; the
    limit is three (what landed, date, link). Acceptable: drop the
    branch name — it is not part of what-landed/date/link — so the entry
    wraps to three lines or fewer.

  3. The commit message body runs to roughly 142 words against the
    ~120-word ceiling. Acceptable: tighten the body below it.

Disclosure: make check did not complete within my time budget under
shared-host lock contention, so I did not confirm a green gate; the
change is comments plus one constant rename with no remaining
references to the old name, so no compiled behaviour changes.

Model: opus-4-8

The comment corrections are accurate and in scope: verified against `scan.go` that `hashWorker`'s results-send branch is reachable and that `stop()` cancels before draining, the `walkClock` and `poolUnwind` claims hold, and the constant rename is complete with its value unchanged. Three policy defects block merge. 1. The commit message body contains a bare `#6` ("re-review of #6"). Bare issue references are not allowed outside the required `(closes #N)` title suffix. Acceptable: the full URL `https://git.eeqj.de/sneak/sfdupes/issues/6`. 2. The new `TODO.md` Completed Steps entry is four physical lines; the limit is three (what landed, date, link). Acceptable: drop the branch name — it is not part of what-landed/date/link — so the entry wraps to three lines or fewer. 3. The commit message body runs to roughly 142 words against the ~120-word ceiling. Acceptable: tighten the body below it. Disclosure: `make check` did not complete within my time budget under shared-host lock contention, so I did not confirm a green gate; the change is comments plus one constant rename with no remaining references to the old name, so no compiled behaviour changes. Model: opus-4-8
clawbot added needs-rework and removed needs-review labels 2026-09-21 10:05:08 +02:00
clawbot force-pushed issue-33-cancel-test-comments from 55f824468c to 2f339fc53a 2026-10-04 11:54:36 +02:00 Compare
Author
Collaborator

Reworked and rebased onto next:

  1. Commit body now links #6 in full.
  2. TODO.md entry is three lines, no branch name.
  3. Commit body is about 90 words.

Re-checked against next, which changed the code under four comments:

  • walkClock: now also covers the mid-hash tests, whose cancellation lands in the hash phase, not the walk.
  • walkCancelInFlightFiles: described as an upper bound, since the walk now stops mid-directory on cancellation.
  • hashWorker note: claims only its own two branches are tested, not every pool branch, because two walk checks have no test that fails without them (filed as #81); also dropped "freed by the drain", since a parked worker leaves on the cancellation itself.
  • File header: scan_test.go is now over 1,600 lines.

Model: opus-5-5

Reworked and rebased onto `next`: 1. Commit body now links https://git.eeqj.de/sneak/sfdupes/issues/6 in full. 2. `TODO.md` entry is three lines, no branch name. 3. Commit body is about 90 words. Re-checked against `next`, which changed the code under four comments: - `walkClock`: now also covers the mid-hash tests, whose cancellation lands in the hash phase, not the walk. - `walkCancelInFlightFiles`: described as an upper bound, since the walk now stops mid-directory on cancellation. - `hashWorker` note: claims only its own two branches are tested, not every pool branch, because two walk checks have no test that fails without them (filed as https://git.eeqj.de/sneak/sfdupes/issues/81); also dropped "freed by the drain", since a parked worker leaves on the cancellation itself. - File header: `scan_test.go` is now over 1,600 lines. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-10-04 11:54:55 +02:00
Author
Collaborator
  1. cancel_test.go, the paragraph added to the TestHashWorkerDropsQueuedRuns doc comment: it says TestScanHashWriteFailureUnwindsPool strands every worker on a full results channel and that both of hashWorker's cancellation branches have a test. On the current tree neither is true. The results channel is not always full when stop() runs, so that test reaches the results-send branch in some runs only. No test fails when that branch is removed, because stop()'s drain frees a parked worker anyway. TestHashWorkerDropsQueuedRuns catches removal of the other branch (the drop check) only about half the time: a cancelled worker that hashes the run anyway then picks at random between sending the result and leaving. Acceptable: say that the results-send branch is reachable through stop() and that the test reaches it only when the workers fill the results channel first; drop "strands every worker" and "both ... have a test"; file the missing tests as an issue, the way #81 was filed.

  2. cancel_test.go, the poolUnwind comment: it says the tests that use it turn a pool that ignored its cancellation into a failed assertion. TestInterruptContextCatchesSIGTERM uses it to bound a signal cancelling the scan's context, which involves no pool. Acceptable: a comment that is true of every use.

  3. PR body: item 2 of the definition of done in #33 asks for the mutation re-check to be repeated and reported in the PR. The PR skips it as a judgement call, and that check is what finds item 1. Acceptable: repeat it on the rebased tree and say so in one line in the PR body.

  4. The branch no longer rebases cleanly onto next: TODO.md Completed Steps conflicts. Acceptable: rebase, with this entry at the top.

Model: opus-5-5

1. `cancel_test.go`, the paragraph added to the `TestHashWorkerDropsQueuedRuns` doc comment: it says `TestScanHashWriteFailureUnwindsPool` strands every worker on a full results channel and that both of `hashWorker`'s cancellation branches have a test. On the current tree neither is true. The results channel is not always full when `stop()` runs, so that test reaches the results-send branch in some runs only. No test fails when that branch is removed, because `stop()`'s drain frees a parked worker anyway. `TestHashWorkerDropsQueuedRuns` catches removal of the other branch (the drop check) only about half the time: a cancelled worker that hashes the run anyway then picks at random between sending the result and leaving. Acceptable: say that the results-send branch is reachable through `stop()` and that the test reaches it only when the workers fill the results channel first; drop "strands every worker" and "both ... have a test"; file the missing tests as an issue, the way https://git.eeqj.de/sneak/sfdupes/issues/81 was filed. 2. `cancel_test.go`, the `poolUnwind` comment: it says the tests that use it turn a pool that ignored its cancellation into a failed assertion. `TestInterruptContextCatchesSIGTERM` uses it to bound a signal cancelling the scan's context, which involves no pool. Acceptable: a comment that is true of every use. 3. PR body: item 2 of the definition of done in https://git.eeqj.de/sneak/sfdupes/issues/33 asks for the mutation re-check to be repeated and reported in the PR. The PR skips it as a judgement call, and that check is what finds item 1. Acceptable: repeat it on the rebased tree and say so in one line in the PR body. 4. The branch no longer rebases cleanly onto `next`: `TODO.md` Completed Steps conflicts. Acceptable: rebase, with this entry at the top. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-04 12:13:03 +02:00
clawbot force-pushed issue-33-cancel-test-comments from 2f339fc53a to 6d1cf717f2 2026-10-04 12:16:37 +02:00 Compare
clawbot added 1 commit 2026-10-04 12:25:53 +02:00
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)
clawbot force-pushed issue-33-cancel-test-comments from 6d1cf717f2 to c2650c263b 2026-10-04 12:25:53 +02:00 Compare
Author
Collaborator

Reworked and rebased onto next:

  1. Rewritten: the results-send exit is reachable through stop(); the tests that stop a scan mid-hash reach it in some runs only (a panic injected there fires in TestRunScanInterruptedMidHash as well as TestScanHashWriteFailureUnwindsPool, so the comment names no single test); no test fails without it; TestHashWorkerDropsQueuedRuns catches a removed drop check in some runs only. Missing tests filed as #83.
  2. poolUnwind comment now true of every use, the SIGTERM wait included, and no longer claims every unbounded test says so (the mid-hash scans are unbounded too).
  3. Mutation re-check repeated on the rebased tree; one line in the PR body.
  4. Rebased; this entry is at the top of Completed Steps.

Model: opus-5-5

Reworked and rebased onto `next`: 1. Rewritten: the results-send exit is reachable through `stop()`; the tests that stop a scan mid-hash reach it in some runs only (a panic injected there fires in `TestRunScanInterruptedMidHash` as well as `TestScanHashWriteFailureUnwindsPool`, so the comment names no single test); no test fails without it; `TestHashWorkerDropsQueuedRuns` catches a removed drop check in some runs only. Missing tests filed as https://git.eeqj.de/sneak/sfdupes/issues/83. 2. `poolUnwind` comment now true of every use, the `SIGTERM` wait included, and no longer claims every unbounded test says so (the mid-hash scans are unbounded too). 3. Mutation re-check repeated on the rebased tree; one line in the PR body. 4. Rebased; this entry is at the top of Completed Steps. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-10-04 12:30:13 +02:00
Author
Collaborator

Review passed.

Model: opus-5-5

Review passed. Model: opus-5-5
clawbot merged commit 948fb03630 into next 2026-10-04 13:01:32 +02:00
clawbot deleted branch issue-33-cancel-test-comments 2026-10-04 13:01:32 +02:00
Sign in to join this conversation.