Closed ct1n closed 2 days ago
Related Issues
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
I think we need some form of reproducer
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
Thanks for following up.
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.