From e1596d655a15c5d5bc402e5bff18f56402ae07f6 Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Wed, 30 Sep 2020 17:16:41 -0700 Subject: [PATCH] tstest: skip resource check when test has failed Signed-off-by: Josh Bleecher Snyder --- tstest/resource.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tstest/resource.go b/tstest/resource.go index e7b716ffa..7be6eecd1 100644 --- a/tstest/resource.go +++ b/tstest/resource.go @@ -40,6 +40,12 @@ func goroutineDump() (int, string) { } func (r *ResourceCheck) Assert(t testing.TB) { + if t.Failed() { + // Something else went wrong. + // Assume that that is responsible for the leak + // and don't pile on a bunch of extra of output. + return + } t.Helper() want := r.startNumRoutines