diff --git a/internal/grpctest/grpctest.go b/internal/grpctest/grpctest.go index dca24ab99842..8acca9579c5a 100644 --- a/internal/grpctest/grpctest.go +++ b/internal/grpctest/grpctest.go @@ -61,8 +61,9 @@ func RunSubTests(t *testing.T, x interface{}) { tfunc := getTestFunc(t, xv, methodName) t.Run(strings.TrimPrefix(methodName, "Test"), func(t *testing.T) { setup(t) + // defer teardown to guarantee it is run even if tfunc uses t.Fatal() + defer teardown(t) tfunc(t) - teardown(t) }) } }