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: test coverage command fails after update to v1.22 #66211

Closed
ivanvc opened this issue Mar 8, 2024 · 2 comments
Closed

cmd/go: test coverage command fails after update to v1.22 #66211

ivanvc opened this issue Mar 8, 2024 · 2 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@ivanvc
Copy link

ivanvc commented Mar 8, 2024

Go version

go version go1.22.1 linux/amd64

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/ivan/.cache/go-build'
GOENV='/home/ivan/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/ivan/.local/share/asdf/installs/golang/1.22.0/packages/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/ivan/.local/share/asdf/installs/golang/1.22.0/packages'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/home/ivan/.local/share/asdf/installs/golang/1.22.1/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/home/ivan/.local/share/asdf/installs/golang/1.22.1/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.22.1'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/home/ivan/Code/Personal/etcd/etcd/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1040169399=/tmp/go-build -gno-record-gcc-switches'

What did you do?

We recently updated etcd-io/etcd to use Go v1.22. However, we noticed that the coverage workflow started failing. Pinpointing the issue, the following command fails to execute:

(cd tests && 'env' 'ETCD_VERIFY=all' 'go' 'test' '-coverprofile=/home/ivan/Code/Personal/etcd/etcd/covdir/unit_tests/all.coverprofile' './...' '-short' '-timeout=30m' '-covermode=set' '-coverpkg=go.etcd.io/etcd/api/v3/...,go.etcd.io/etcd/pkg/v3/...,go.etcd.io/etcd/clien    t/pkg/v3/...,go.etcd.io/etcd/client/v2/...,go.etcd.io/etcd/client/v3/...,go.etcd.io/etcd/server/v3/...,go.etcd.io/etcd/etcdutl/v3/...,go.etcd.io/etcd/etcdctl/v3/...')  

This is an example failure run (which contains the full logs): https://github.com/etcd-io/etcd/actions/runs/8201796236/job/22431264170

What did you see happen?

Running the previous command shows some errors regarding opening the coverage metadata for the passed coverpkgs:

go.etcd.io/etcd/tests/v3/framework: open /tmp/go-build3114120347/b432/covmeta.af998dfcb0086f845cdda1adfdc9c5921e6ebf59c09d8b5087a51af329656d68: no such file or directory
go.etcd.io/etcd/tests/v3/framework/config: open /tmp/go-build3114120347/b501/covmeta.993ad11e2c1ac100575143c8ae339bd60d5a4205f6e06dc7d228251e4922b857: no such file or directory
go.etcd.io/etcd/tests/v3/framework/integration: open /tmp/go-build3114120347/b507/covmeta.af60822fd178ac2a1d6a6d3632772388db2eef8eebe69a54f71f5229b4194d83: no such file or directory
go.etcd.io/etcd/tests/v3/framework/interfaces: open /tmp/go-build3114120347/b502/covmeta.c4413a0b0bee1fe776fd4eee20aa15cc57fe7766203af0896ae6da4e9fdcfaf0: no such file or directory
go.etcd.io/etcd/tests/v3/framework/unit: open /tmp/go-build3114120347/b530/covmeta.3ee2e2ccbd9d8151307a5d3e3f5c569a6200c70fee62670a6cf54bd53371cf29: no such file or directory
go.etcd.io/etcd/tests/v3/robustness/failpoint: open /tmp/go-build3114120347/b537/covmeta.45a17b05937b97f5e89a5f0e2405846041f36f7d5ced142e827f1f24a847ae3f: no such file or directory
go.etcd.io/etcd/tests/v3/robustness/identity: open /tmp/go-build3114120347/b610/covmeta.1c9f6aed500c222fde34e58ec420ec7d20b92ec518c32b8c1a36d05e45d6a706: no such file or directory
ok    go.etcd.io/etcd/tests/v3/common 0.010s
ok    go.etcd.io/etcd/tests/v3/e2e  0.053s  coverage: 1.0% of statements in go.etcd.io/etcd/api/v3/..., go.etcd.io/etcd/pkg/v3/..., go.etcd.io/etcd/client/pkg/v3/..., go.etcd.io/etcd/client/v2/..., go.etcd.io/etcd/client/v3/..., go.etcd.io/etcd/server/v3/..., go.etcd.io/etcd/etcdutl/v3/..., go.etcd.io/etcd/etcdctl/v3/..
...

The command finishes with an exit code 1.

What did you expect to see?

The command should execute without errors.

If I run it with GOEXPERIMENT=nocoverageredesign. It works as it used to work with Go 1.21.8.

@mknyszek
Copy link
Contributor

mknyszek commented Mar 9, 2024

CC @thanm

@mknyszek mknyszek added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Mar 9, 2024
@thanm
Copy link
Contributor

thanm commented Mar 11, 2024

This is almost certainly a dup of #65653 . Recommend that you use the GOEXPERIMENT workaround for now, this should be fixed in the next minor release of 1.22. Thanks.

@thanm thanm closed this as completed Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants