On Unix platforms, it's possible that the net package will launch
goroutines that we cannot terminate and could live for an indeterminate
time; the stack looks like this:
1 @ 0x43ae6e 0x81f72b 0x822392 0x82189d 0x8224a7 0x4a5d41
# 0x81f72a net._C2func_getaddrinfo+0x8a _cgo_gotypes.go:94
# 0x822391 net.cgoLookupIPCNAME.func1+0xb1 /go/1.19.2/x64/src/net/cgo_unix.go:160
# 0x82189c net.cgoLookupIPCNAME+0x27c /go/1.19.2/x64/src/net/cgo_unix.go:160
# 0x8224a6 net.cgoIPLookup+0x66 /go/1.19.2/x64/src/net/cgo_unix.go:217
In tests that do DNS lookups, it's possible that these goroutines will
result in a test flake. Rather than try to carefully shut those down,
just ignore them entirely when counting goroutines.
Signed-off-by: Andrew Dunham <andrew@du.nham.ca>
Change-Id: I25907e29d1a6b43a95002e1b55208cb965b9bfa4
Use tb.Cleanup to simplify both the API and the implementation.
One behavior change: When the number of goroutines shrinks, don't log.
I've never found these logs to be useful, and they frequently add noise.
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
Inclusion of the word "assert" made it seem like a failure, even though
it was supposed to be identifying the name of the function (Assert()).
Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>