uber-go / goleak

Goroutine leak detector
MIT License
4.5k stars 148 forks source link

False positive with go test -trace=test.out #39

Closed imatmati closed 4 years ago

imatmati commented 4 years ago

As stated in the title, when you invoke the test command with a trace option, the test always fails with a message concerning trace:

--- FAIL: TestAnd (0.45s) leaks.go:78: found unexpected goroutines: [Goroutine 6 in state trace reader (blocked), with runtime.goparkunlock on top of the stack: goroutine 6 [trace reader (blocked)]: runtime.goparkunlock(...) c:/go/src/runtime/proc.go:310

Even when the test is empty like this one :

package main

import (
    "testing"

    "go.uber.org/goleak"
)

func TestAnd(t *testing.T) {
    defer goleak.VerifyNone(t)

}