From a1f1020042ac79e32c15da7faf2be061dca7a5aa Mon Sep 17 00:00:00 2001 From: David Crawshaw Date: Mon, 30 Aug 2021 14:06:47 +0000 Subject: [PATCH] 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 --- tstest/integration/vms/harness_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tstest/integration/vms/harness_test.go b/tstest/integration/vms/harness_test.go index 50fd917a0..e606f40c7 100644 --- a/tstest/integration/vms/harness_test.go +++ b/tstest/integration/vms/harness_test.go @@ -71,6 +71,9 @@ func newHarness(t *testing.T) *Harness { lc := &integration.LogCatcher{} if *verboseLogcatcher { lc.UseLogf(t.Logf) + t.Cleanup(func() { + lc.UseLogf(nil) // do not log after test is complete + }) } mux.Handle("/c/", lc)