MCPcopy
hub / github.com/grpc/grpc-go / TestLeakChecker_PassesOnCleanup

Function TestLeakChecker_PassesOnCleanup

internal/leakcheck/leakcheck_test.go:160–173  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

158}
159
160func TestLeakChecker_PassesOnCleanup(t *testing.T) {
161 TrackAsyncReporters()
162 defer func() {
163 internal.AsyncReporterCleanupDelegate = func(f func()) func() { return f }
164 }()
165 noOpCleanup := func() {}
166 wrappedCleanup := internal.AsyncReporterCleanupDelegate(noOpCleanup)
167 wrappedCleanup()
168 tl := &testLogger{}
169 CheckAsyncReporters(tl)
170 if tl.errorCount > 0 {
171 t.Errorf("Expected no leaks, but got errors: %v", tl.errors)
172 }
173}

Callers

nothing calls this directly

Calls 3

TrackAsyncReportersFunction · 0.85
CheckAsyncReportersFunction · 0.85
ErrorfMethod · 0.65

Tested by

no test coverage detected