wgengine: fix logger data race in tests

Observed in:
    https://github.com/tailscale/tailscale/actions/runs/8350904950/job/22858266932?pr=11463

Updates #11226

Signed-off-by: Andrew Dunham <andrew@du.nham.ca>
Change-Id: I9b57db4b34b6ad91d240cd9fa7e344fc0376d52d
This commit is contained in:
Andrew Dunham 2024-03-19 18:32:34 -04:00
parent e382e4cee6
commit 6da1dc84de

View File

@ -9,6 +9,7 @@
"github.com/tailscale/wireguard-go/tun" "github.com/tailscale/wireguard-go/tun"
"tailscale.com/net/tstun" "tailscale.com/net/tstun"
"tailscale.com/tsd" "tailscale.com/tsd"
"tailscale.com/tstest"
"tailscale.com/types/logger" "tailscale.com/types/logger"
"tailscale.com/wgengine" "tailscale.com/wgengine"
"tailscale.com/wgengine/netstack" "tailscale.com/wgengine/netstack"
@ -17,7 +18,10 @@
func TestIsNetstack(t *testing.T) { func TestIsNetstack(t *testing.T) {
sys := new(tsd.System) sys := new(tsd.System)
e, err := wgengine.NewUserspaceEngine(t.Logf, wgengine.Config{SetSubsystem: sys.Set}) e, err := wgengine.NewUserspaceEngine(
tstest.WhileTestRunningLogger(t),
wgengine.Config{SetSubsystem: sys.Set},
)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }