Add a race-detector test target for the concurrent scan paths #18
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
TODO.mdrecords "go test runs without-race" as an accepted divergence, justified by the mandatedCGO_ENABLED=0— the race detector needs cgo. The justification is correct for the shipped binary and wrong as a reason to never run the detector at all.The riskiest code in this repo is precisely the concurrent part: the walk dispatcher (
scan.go:619-648), the walk and hash worker pools (scan.go:590-613,scan.go:788-801), and the sharedevents/subdirs/resultschannels. Nothing currently checks any of it for races, and issues #5, #6 and #13 all add or change synchronization in exactly that code.The org-standard
make testrecipe includes-race; this repo dropped it wholesale rather than isolating it.Definition of done
script/test-racerunsCGO_ENABLED=1 go test -race -timeout 60s ./...(or a-runsubset covering the walk, scan and hash tests if the full suite is too slow), with a matchingmake test-raceshim.make check, somake checkstays pure-Go and fast.CGO_ENABLED=0; the shipped binary stays pure Go with no new dependency on a C toolchain.TODO.md's accepted-divergence note is rewritten to say the detector runs in a separate cgo-enabled target rather than not at all.make test-race.make checkgreen andmake test-raceclean.