From 8fd5d3eaf3d8a92a381f9250dc56d5dd15f3d326 Mon Sep 17 00:00:00 2001 From: Maisem Ali Date: Fri, 29 Jul 2022 09:48:35 -0700 Subject: [PATCH] tstest: do not error if the there are fewer goroutines than at start This fixes test failures like: ``` resource.go:34: goroutine count: expected 3, got 2 ``` Signed-off-by: Maisem Ali --- tstest/resource.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tstest/resource.go b/tstest/resource.go index 5b770986d..ae085ef5c 100644 --- a/tstest/resource.go +++ b/tstest/resource.go @@ -30,6 +30,9 @@ func ResourceCheck(tb testing.TB) { time.Sleep(5 * time.Millisecond) } endN, endStacks := goroutines() + if endN <= startN { + return + } tb.Logf("goroutine diff:\n%v\n", cmp.Diff(startStacks, endStacks)) tb.Fatalf("goroutine count: expected %d, got %d\n", startN, endN) })