Skip to content
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: go test cache unaffected by GODEBUG value #65436

Open
findleyr opened this issue Feb 1, 2024 · 4 comments
Open

cmd/go: go test cache unaffected by GODEBUG value #65436

findleyr opened this issue Feb 1, 2024 · 4 comments
Labels
GoCommand cmd/go help wanted NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@findleyr
Copy link
Contributor

findleyr commented Feb 1, 2024

As we work on getting x/tools tests passing with GODEBUG=gotypesalias=1 in #65294, I noticed that GODEBUG is not included in the test cache key. It probably should be.

[gopls]> go test -count=1 ./doc
ok      golang.org/x/tools/gopls/doc    1.912s
[gopls]> GODEBUG=gotypesalias=1 go test ./doc
ok      golang.org/x/tools/gopls/doc    (cached)
[gopls]> GODEBUG=gotypesalias=1 go test -count=1 ./doc
--- FAIL: TestGenerated (1.71s)
    generate_test.go:26: documentation needs updating. Run: cd gopls && go generate
FAIL
FAIL    golang.org/x/tools/gopls/doc    1.774s
FAIL

CC @bcmills @matloob

@bcmills
Copy link
Member

bcmills commented Feb 1, 2024

Adding GODEBUG to the test cache key seems appropriate — every Go program depends on GODEBUG via the runtime package, and it is likely that the runtime parses that variable in a way that is not visible to the test log.

@bcmills bcmills added NeedsFix The path to resolution is known, but the work has not been done. GoCommand cmd/go labels Feb 1, 2024
@bcmills bcmills added this to the Backlog milestone Feb 1, 2024
@bcmills

This comment was marked as outdated.

@bcmills bcmills marked this as a duplicate of #51561 Feb 1, 2024
@bcmills bcmills closed this as not planned Won't fix, can't repro, duplicate, stale Feb 1, 2024
@bcmills

This comment was marked as off-topic.

@bcmills bcmills reopened this Feb 1, 2024
@bcmills bcmills marked this as not a duplicate of #51561 Feb 1, 2024
@bcmills
Copy link
Member

bcmills commented Feb 1, 2024

Other environment variables go into the test-output cache key here:
https://cs.opensource.google/go/go/+/master:src/cmd/go/internal/test/test.go;l=1869-1870;drc=e076c1b897b30648db794b66fd10929fe9a9852e

GODEBUG is probably not being recorded their because it is parsed directly by the runtime package without going through the usual os.Getenv hooks. We should probably add it to the cache key explicitly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GoCommand cmd/go help wanted NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

2 participants