Repository navigation
cmd/go: clarify test cache behavior for file metadata - #82377
FawwazLawal wants to merge 1 commit into
Conversation
The help text for go test -run says that for test inputs that are files, the test result cache checks content. In practice, the cache checks file metadata such as modification time and size, not content. This wording has been a recurring source of confusion (see golang#35301). Update the help text in test.go and regenerate alldocs.go. Updates golang#35301
|
This PR (HEAD: 9ea20b6) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/go/+/851825. Important tips:
|
|
Message from Gopher Robot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be During May-July and Nov-Jan the Go project is in a code freeze, during which Please don’t reply on this GitHub thread. Visit golang.org/cl/851825. |
The help text for go test -run says that for test inputs that
are files, the test result cache checks content. In practice,
the cache checks file metadata such as modification time and
size, not content (see hashWriteStat in
src/cmd/go/internal/cache/hash.go). This wording has been a
recurring source of confusion.
Update the help text in test.go and regenerate alldocs.go to
say "file metadata such as modification time and size" instead
of "content".
I noticed the discrepancy while working through the test caching
behavior described in #35301. My earlier repro comment
(#35301 (comment))
shows the practical effect: modifying a testdata file without
changing its mtime does not invalidate the cache. This is the
expected behavior given hashWriteStat, but the help text implies
otherwise.
Updates #35301