You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running test coverage using a docker golang:1.22-alpine3.19 container. We run the following command:
go test -v -parallel 24 -p 24 -count 1 -covermode=atomic -coverprofile /coverage/coverage.out --timeout 30s ./...
What did you see happen?
The go test command sometimes generates either a line containing just the digit 0 at the end of coverage.out, or an empty line (though this seems rarer and I haven't checked that it's at the end of the file).
Trying to parse coverage.out with github.com/AlekSi/gocov-xml results in error: line "0" doesn't match expected format: couldn't find a before Count (from golang.org/x/tools.cover).
Other than the last line coverage.out seems valid: it starts with mode: atomic and contains about 15k report lines.
Not very easy to reproduce.
What did you expect to see?
A valid coverage.out profile that can be loaded by golang.org/x/tools/cover.
We can work around this pretty easily, but thought it might be useful in case others encounter this. Also it might be an easy fix.
The text was updated successfully, but these errors were encountered:
Sorry for the noise. It seems this was because of our build process. Sometimes 2 builds ran at the same time and they weren't properly isolated, using the same output directory
Go version
go1.22.9 linux/amd64
Output of
go env
in your module/workspace:What did you do?
Running test coverage using a docker golang:1.22-alpine3.19 container. We run the following command:
go test -v -parallel 24 -p 24 -count 1 -covermode=atomic -coverprofile /coverage/coverage.out --timeout 30s ./...
What did you see happen?
The go test command sometimes generates either a line containing just the digit 0 at the end of coverage.out, or an empty line (though this seems rarer and I haven't checked that it's at the end of the file).
Trying to parse coverage.out with github.com/AlekSi/gocov-xml results in
error: line "0" doesn't match expected format: couldn't find a before Count
(from golang.org/x/tools.cover).Other than the last line coverage.out seems valid: it starts with
mode: atomic
and contains about 15k report lines.Not very easy to reproduce.
What did you expect to see?
A valid coverage.out profile that can be loaded by golang.org/x/tools/cover.
We can work around this pretty easily, but thought it might be useful in case others encounter this. Also it might be an easy fix.
The text was updated successfully, but these errors were encountered: