mirror of
https://github.com/tailscale/tailscale.git
synced 2025-02-18 02:48:40 +00:00
wgengine: prevent log after exit in watchdog test
Signed-off-by: Dmytro Shynkevych <dmytro@tailscale.com>
This commit is contained in:
parent
16b2bbbbbb
commit
e9643ae724
@ -24,6 +24,8 @@ func TestWatchdog(t *testing.T) {
|
|||||||
|
|
||||||
e = NewWatchdog(e)
|
e = NewWatchdog(e)
|
||||||
e.(*watchdogEngine).maxWait = 150 * time.Millisecond
|
e.(*watchdogEngine).maxWait = 150 * time.Millisecond
|
||||||
|
e.(*watchdogEngine).logf = t.Logf
|
||||||
|
e.(*watchdogEngine).fatalf = t.Fatalf
|
||||||
|
|
||||||
e.RequestStatus()
|
e.RequestStatus()
|
||||||
e.RequestStatus()
|
e.RequestStatus()
|
||||||
@ -65,5 +67,9 @@ func TestWatchdog(t *testing.T) {
|
|||||||
case <-time.After(3 * time.Second):
|
case <-time.After(3 * time.Second):
|
||||||
t.Fatalf("watchdog failed to fire")
|
t.Fatalf("watchdog failed to fire")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
usEngine.wgLock.Unlock()
|
||||||
|
wdEngine.fatalf = t.Fatalf
|
||||||
|
wdEngine.Close()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user