From e9643ae7242c3fdac823d958e9c7a28c5633620a Mon Sep 17 00:00:00 2001 From: Dmytro Shynkevych Date: Fri, 3 Jul 2020 03:00:45 -0400 Subject: [PATCH] wgengine: prevent log after exit in watchdog test Signed-off-by: Dmytro Shynkevych --- wgengine/watchdog_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wgengine/watchdog_test.go b/wgengine/watchdog_test.go index 4c86d8ebe..7487d4827 100644 --- a/wgengine/watchdog_test.go +++ b/wgengine/watchdog_test.go @@ -24,6 +24,8 @@ func TestWatchdog(t *testing.T) { e = NewWatchdog(e) e.(*watchdogEngine).maxWait = 150 * time.Millisecond + e.(*watchdogEngine).logf = t.Logf + e.(*watchdogEngine).fatalf = t.Fatalf e.RequestStatus() e.RequestStatus() @@ -65,5 +67,9 @@ func TestWatchdog(t *testing.T) { case <-time.After(3 * time.Second): t.Fatalf("watchdog failed to fire") } + + usEngine.wgLock.Unlock() + wdEngine.fatalf = t.Fatalf + wdEngine.Close() }) }