ipn: close logger at the end of TestLocalLogLines

If any goroutine continues to use the logger in TestLocalLogLines
after the test finishes, the test panics.

The culprit for this was wireguard-go; the previous commit fixed that.
This commit adds suspenders: When the test is done, make logging calls
into no-ops.

Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
This commit is contained in:
Josh Bleecher Snyder
2021-01-08 16:50:03 -08:00
committed by Josh Bleecher Snyder
parent 1e4604f60e
commit 18471a8792
2 changed files with 15 additions and 2 deletions

View File

@@ -26,6 +26,7 @@ func TestLocalLogLines(t *testing.T) {
"[v1] peer keys: %s",
"[v1] v%v peers: %v",
})
defer logListen.Close()
logid := func(hex byte) logtail.PublicID {
var ret logtail.PublicID