Re: [go-nuts] tip: data race when running test with coverage

2022-10-02 Thread Shulhan
On Sun, 2 Oct 2022 20:45:08 +1100 Rob Pike wrote: > This is a race in new code, then, so please file an issue at > https://go.dev/issue/new > > -rob > Done, https://github.com/golang/go/issues/56006 Thank you for walking me through this. -- You received this message because you are subscrib

Re: [go-nuts] tip: data race when running test with coverage

2022-10-02 Thread Rob Pike
This is a race in new code, then, so please file an issue at https://go.dev/issue/new -rob On Sun, Oct 2, 2022 at 7:40 PM Shulhan wrote: > > On Sun, 2 Oct 2022 19:22:21 +1100 > Rob Pike wrote: > > > Apologies, the cover tool calls it -mode but the go command calls it > > -covermode. > > > > go

Re: [go-nuts] tip: data race when running test with coverage

2022-10-02 Thread Shulhan
On Sun, 2 Oct 2022 19:22:21 +1100 Rob Pike wrote: > Apologies, the cover tool calls it -mode but the go command calls it > -covermode. > > go test -covermode=atomic > > -rob > > Got it, thanks, but it still fail with the data race. (ins) 1 $ GOEXPERIMENT=coverageredesign CGO_ENABLED=1

Re: [go-nuts] tip: data race when running test with coverage

2022-10-02 Thread Rob Pike
Also, it is documented: % go help testflag | grep mode -covermode set,count,atomic Set the mode for coverage analysis for the package[s] When 'go test' runs in package list mode, 'go test' caches successful % On Sun, Oct 2, 2022 at 7:22 PM Rob Pike wrote: > Apologies, the cover tool cal

Re: [go-nuts] tip: data race when running test with coverage

2022-10-02 Thread Rob Pike
Apologies, the cover tool calls it -mode but the go command calls it -covermode. go test -covermode=atomic -rob On Sun, Oct 2, 2022 at 3:48 PM Shulhan wrote: > On Sun, 2 Oct 2022 10:41:17 +1100 > Rob Pike wrote: > > > When running coverage in a concurrent program, use the -mode=atomic > > fl

Re: [go-nuts] tip: data race when running test with coverage

2022-10-01 Thread Shulhan
On Sun, 2 Oct 2022 10:41:17 +1100 Rob Pike wrote: > When running coverage in a concurrent program, use the -mode=atomic > flag to avoid data races in the counters. This unavoidably has a > significant performance hit, but it should resolve this race. > > -rob > This flag print "no test files"

Re: [go-nuts] tip: data race when running test with coverage

2022-10-01 Thread Rob Pike
When running coverage in a concurrent program, use the -mode=atomic flag to avoid data races in the counters. This unavoidably has a significant performance hit, but it should resolve this race. -rob On Sun, Oct 2, 2022 at 5:10 AM Shulhan wrote: > Hi gophers, > > The latest Go tip always fail