Search and commands

↑ ↓ to select · Enter to open · Esc to close

Type to search packages.

leakcheck

v1.51.4
github.com/lfch/grpc/internal/leakcheck

Documentation

pkg.go.dev ↗

Table of contents

↓ to select · Enter to jump· Shift+Enter for source

5 matches

Top ↑

Package leakcheck contains functions to check leaked goroutines.

Call "defer leakcheck.Check(t)" at the beginning of tests.

Functions

Check

func Check(efer Errorfer)

Check looks at the currently-running goroutines and checks if there are any interesting (created by gRPC) goroutines leaked. It waits up to 10 seconds in the error cases.

RegisterIgnoreGoroutine

func RegisterIgnoreGoroutine(s string)

RegisterIgnoreGoroutine appends s into the ignore goroutine list. The goroutines whose stack trace contains s will not be identified as leaked goroutines. Not thread-safe, only call this function in init().

Types

Errorfer

type Errorfer interface {
	Errorf(format string, args ...interface{})
}

Errorfer is the interface that wraps the Errorf method. It's a subset of testing.TB to make it easy to use Check.

Dependency graph