all: close fake userspace engines when tests complete

We were leaking FDs.
In a few places, switch from defer to t.Cleanup.

Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
This commit is contained in:
Josh Bleecher Snyder
2021-09-15 11:48:49 -07:00
committed by Josh Bleecher Snyder
parent 008f36986e
commit 7693d36aed
6 changed files with 7 additions and 3 deletions

View File

@@ -443,6 +443,7 @@ func TestLazyMachineKeyGeneration(t *testing.T) {
if err != nil {
t.Fatalf("NewFakeUserspaceEngine: %v", err)
}
t.Cleanup(eng.Close)
lb, err := NewLocalBackend(logf, "logid", store, eng)
if err != nil {
t.Fatalf("NewLocalBackend: %v", err)