]> Cypherpunks repositories - gostls13.git/commit
cmd/go: limit test input file change detection to local GOROOT/GOPATH tree
authorRuss Cox <rsc@golang.org>
Tue, 9 Jan 2018 20:16:29 +0000 (15:16 -0500)
committerRuss Cox <rsc@golang.org>
Wed, 10 Jan 2018 20:29:33 +0000 (20:29 +0000)
commit37d56279c87818b496e5717bddd1f7c43bfa743d
tree2f02bd90bcb2c22ac76b67ee61903febca821c05
parentc203696aa5d11c05e66905526254ca39f8ad2fd2
cmd/go: limit test input file change detection to local GOROOT/GOPATH tree

We've had a series of problems with tests unexpectedly (and innocently)
looking at system files that appear to (but don't) change in meaningful ways,
like /dev/null on OS X having a modification time set to the current time.

Cut all these off by only applying file change detection to the local package
root: the GOROOT or specific sub-GOPATH in which the package being tested
is found.

(This means that if you test reads /tmp/x and you change /tmp/x, the cached
result will still be used. Don't do that, or else use -count=1.)

Fixes #23390.

Change-Id: I30b6dd194835deb645a040aea5e6e4f68af09edb
Reviewed-on: https://go-review.googlesource.com/87015
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/go/go_test.go
src/cmd/go/internal/load/path.go
src/cmd/go/internal/load/pkg.go
src/cmd/go/internal/str/path.go [new file with mode: 0644]
src/cmd/go/internal/test/test.go