GODEBUG affects test execution but was not being tracked.
Fixes #66213.
Fixes #65436.
Change-Id: I3ac3c397f0c6fa46cd9be0d22d03020d0632f64f
Reviewed-on: https://go-review.googlesource.com/c/go/+/570259
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Russ Cox <rsc@golang.org>
func computeTestInputsID(a *work.Action, testlog []byte) (cache.ActionID, error) {
testlog = bytes.TrimPrefix(testlog, testlogMagic)
h := cache.NewHash("testInputs")
+ // The runtime always looks at GODEBUG, without telling us in the testlog.
+ fmt.Fprintf(h, "env GODEBUG %x\n", hashGetenv("GODEBUG"))
pwd := a.Package.Dir
for _, line := range bytes.Split(testlog, []byte("\n")) {
if len(line) == 0 {
go test testcache -run=TestLookupEnv
stdout '\(cached\)'
+# GODEBUG is always read
+env GODEBUG=asdf=1
+go test testcache -run=TestLookupEnv
+! stdout '\(cached\)'
+go test testcache -run=TestLookupEnv
+stdout '\(cached\)'
+env GODEBUG=
+
env TESTKEY=y
go test testcache -run=TestLookupEnv
! stdout '\(cached\)'