-
Notifications
You must be signed in to change notification settings - Fork 17.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/go: standard library tests fail with GO111MODULE=auto #69202
Comments
I can't recreate this problem, either with Go 1.22 or HEAD. For me the test passes.
I don't see what in the test depends on |
@ianlancetaylor The test is dependent upon
Also, what is your working directory when you run the test? If you run it from Also, be sure to clear your test cache first, due to the bug I filed in #69203. |
Thanks. I see the problem if I run As you probably know, the problem is because in non-module mode the go tool assumes that it is running Go version 1.20. It looks through the list of entries in the internal/godebugs package. For each one whose asynctimerchan=1,gotypesalias=0,httplaxcontentlength=1,httpmuxgo121=1,httpservecontentkeepheaders=1,netedns0=0,panicnil=1,randseednop=0,tls10server=1,tls3des=1,tlskyber=0,tlsrsakex=1,tlsunsafeekm=1,winreadlinkvolume=0,winsymlink=0,x509keypairleaf=0,x509negativeserial=1 I think the right fix is going to be to change the cmd/go tool so that when testing the standard library we look at the go.mod file in the standard library. After all, the go.mod file from where cmd/go is run doesn't really matter when testing the standard library. And we should say that testing the standard library with |
Go version
go version go1.22.6 darwin/amd64
Output of
go env
in your module/workspace:What did you do?
go test net/http -v -run=^TestReadResponseErrors$
What did you see happen?
What did you expect to see?
This is because
GODEBUG
is not getting the expected default value due toGO111MODULE=auto
.Explicitly running
GO111MODULE=on go test net/http -v -run=^TestReadResponseErrors$
causes it to pass.The text was updated successfully, but these errors were encountered: