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/cover: empty profile #45285

Closed
devplayerJoe opened this issue Mar 29, 2021 · 6 comments
Closed

cmd/cover: empty profile #45285

devplayerJoe opened this issue Mar 29, 2021 · 6 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@devplayerJoe
Copy link

What version of Go are you using (go version)?

$ go version
go version go1.13.9 darwin/amd64

Does this issue reproduce with the latest release?

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="$HOME/Library/Caches/go-build"
GOENV="$HOME/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="$HOME/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="$HOME/go/project1/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/nt/gc7658bs1132ttlcjdmlwwxm0000gn/T/go-build221587211=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

I am generating respective coverage files for each _test.go file. However, I am getting an error while executing the gocovmerge command from last few days. I first encountered it on 25 March, then on 26-27 March, it worked fine. But again from 28-29 March, I am facing the same issue again.

Executed below command to generate merged coverage profile file

gocovmerge ${coverageDir}/myTest-*-coverage.profile

What did you expect to see?

Merged coverage profile file being generated without any error

What did you see instead?

2021/03/30 01:43:34 failed to parse profiles: line "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" doesn't match expected format: couldn't find a   before Count

Kindly assist in nailing down the issue.

@devplayerJoe devplayerJoe changed the title master bracnh:: tools/cover/profile.go : doesn't match expected format: couldn't find a before Count master branch:: tools/cover/profile.go : doesn't match expected format: couldn't find a before Count Mar 29, 2021
@seankhliao seankhliao changed the title master branch:: tools/cover/profile.go : doesn't match expected format: couldn't find a before Count cmd/cover: empty profile Mar 29, 2021
@seankhliao
Copy link
Member

  • go1.13 is no longer supported
  • gocovmerge is not part of the Go project
  • There isn't any info for us to do anything about this

For questions please refer to https://github.com/golang/go/wiki/Questions

@seankhliao seankhliao added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Mar 29, 2021
@devplayerJoe
Copy link
Author

go1.13 is no longer supported-----> From when has this happened w.r.t. code pofile?

@devplayerJoe
Copy link
Author

devplayerJoe commented Mar 31, 2021

Got one coverage file having binary data. There are 40 ish test patterns for unit tests and all of them are creating separate coverage profile file ${profileName}.profile with command:
go test -p 1 -cover -v ./${pkgName} -run ${pattern} -coverprofile=${profileName}.profile ./${pkgName}
All other files are 1M in size and only file containing binary data in end has size 148K.
Any pointers on why it could happen?

@davecheney
Copy link
Contributor

davecheney commented Mar 31, 2021

A bit of a long shot, but ./${pkgName} should appear at the end of the argument list, not intermixed with hyphenated flags. Maybe that helps.

@devplayerJoe
Copy link
Author

Got one coverage file having binary data. There are 40 ish test patterns for unit tests and all of them are creating separate coverage profile file ${profileName}.profile with command:
go test -p 1 -cover -v ./${pkgName} -run ${pattern} -coverprofile=${profileName}.profile ./${pkgName}
All other files are 1M in size and only file containing binary data in end has size 148K.
Any pointers on why it could happen?

Sorry for the typo: ./${pkgName} is ${pkgName} :
go test -p 1 -cover -v ${pkgName} -run ${pattern} -coverprofile=${profileName}.profile ${pkgName}

Keeping ${pkgName} at the end of the argument list is not helping...still the problem persists.

@mvdan
Copy link
Member

mvdan commented Jun 15, 2021

Closing old issues that still have the WaitingForInfo label where enough details to investigate weren't provided. Feel free to leave a comment with more details and we can reopen.

@mvdan mvdan closed this as completed Jun 15, 2021
@golang golang locked and limited conversation to collaborators Jun 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

5 participants