mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-21 18:42:36 +00:00
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:

committed by
Josh Bleecher Snyder

parent
008f36986e
commit
7693d36aed
@@ -89,7 +89,7 @@ func TestUserspaceEngineReconfig(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer e.Close()
|
||||
t.Cleanup(e.Close)
|
||||
ue := e.(*userspaceEngine)
|
||||
|
||||
routerCfg := &router.Config{}
|
||||
@@ -158,7 +158,7 @@ func TestUserspaceEnginePortReconfig(t *testing.T) {
|
||||
if ue == nil {
|
||||
t.Fatal("could not create a wgengine with a specific port")
|
||||
}
|
||||
defer ue.Close()
|
||||
t.Cleanup(ue.Close)
|
||||
|
||||
startingPort := ue.magicConn.LocalPort()
|
||||
nodeKey := nkFromHex("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
|
||||
|
Reference in New Issue
Block a user