mirror of
https://github.com/tailscale/tailscale.git
synced 2025-03-28 12:02:23 +00:00
tstest/integration/vms: avoid log after test completion
Avoids a panic in the Go testing package if a late log comes in. Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
This commit is contained in:
parent
583af7c1a6
commit
a1f1020042
@ -71,6 +71,9 @@ func newHarness(t *testing.T) *Harness {
|
|||||||
lc := &integration.LogCatcher{}
|
lc := &integration.LogCatcher{}
|
||||||
if *verboseLogcatcher {
|
if *verboseLogcatcher {
|
||||||
lc.UseLogf(t.Logf)
|
lc.UseLogf(t.Logf)
|
||||||
|
t.Cleanup(func() {
|
||||||
|
lc.UseLogf(nil) // do not log after test is complete
|
||||||
|
})
|
||||||
}
|
}
|
||||||
mux.Handle("/c/", lc)
|
mux.Handle("/c/", lc)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user