Open edaniels opened 1 year ago
Thank you for the detailed bug report and the minimal reproduction!
I ran this test using go test -race -count=1 -json .
and I noticed that sometimes the data race output has Test: ""
, and other times it has Test: "TestRace"
. This confirms the problem is an issue with test2json
. The data race output is being attributed to the package instead of the test.
It looks like there is an open issue about this problem: https://github.com/golang/go/issues/58634
gotestsum
v1.9.0. When I run the test case with v1.9.0
I see that sometimes the data race is attributed to the test, and sometimes it attributed the package, but very rarely it's neither. In those rare cases it must be missing from the go test
output entirely.Upgrading to gotestsum
v1.9.0
should mostly work around the problem until it's fixed in the go toolchain.
That does not appear to help the issue on v1.9.0
Thank you for checking if it would though!
It is still an issue for me in v1.11.0
.
Just to confirm: I am using junit as output and not json and see the same issue, is it because the junit output is relying on json internally?
I also bumped into this issue using following command:
go run gotest.tools/gotestsum@latest -- -timeout 10m -race -v -count=1 ./...
any news on this issue?
With the following test and
gotestsum -- -race
, the race detector output is inconsistently output.Expected (sometimes):
Actual (sometimes):