-
Notifications
You must be signed in to change notification settings - Fork 159
Closed
Description
Problem:
Using goleak with trace flag in earlier versions of go (go1.13.10) is working fine due to fixed issue #39.
But in recent version of go (go1.17.1) testing simple programs with trace flag
is failing again. I think the stack trace has now hidden the call to runtime.goparkunlock
func Test(t *testing.T) {
defer goleak.VerifyNone(t)
}
make test:
[Goroutine 18 in state trace reader (blocked), with runtime.ReadTrace on top of the stack:
goroutine 18 [trace reader (blocked)]:
runtime.ReadTrace()
/usr/local/go/src/runtime/trace.go:412 +0xd2
runtime/trace.Start.func1()
/usr/local/go/src/runtime/trace/trace.go:129 +0x47
created by runtime/trace.Start
/usr/local/go/src/runtime/trace/trace.go:127 +0xf4
Possible Solution:
Removing this piece of code:
Lines 159 to 161 in 1e9de54
if f := s.FirstFunction(); f != "runtime.goparkunlock" { | |
return false | |
} |
Metadata
Metadata
Assignees
Labels
No labels