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>
pull/2755/head
David Crawshaw 3 years ago committed by David Crawshaw
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…
Cancel
Save