From e9f92ecb246cdfca4bf4929f564cf004a76ba0fd Mon Sep 17 00:00:00 2001 From: Nathan VanBenschoten Date: Mon, 20 Mar 2023 09:55:47 -0400 Subject: [PATCH] kv: add log scope to BenchmarkSingleRoundtripWithLatency Informs #98887. Avoids mixing logs with benchmark results, which breaks benchdiff. Release note: None --- pkg/kv/kvclient/kvcoord/txn_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/kv/kvclient/kvcoord/txn_test.go b/pkg/kv/kvclient/kvcoord/txn_test.go index 33c40847eb97..6b4c52680a5c 100644 --- a/pkg/kv/kvclient/kvcoord/txn_test.go +++ b/pkg/kv/kvclient/kvcoord/txn_test.go @@ -104,6 +104,8 @@ func TestTxnDBBasics(t *testing.T) { // to the same key back to back in a single round-trip. Latency is simulated // by pausing before each RPC sent. func BenchmarkSingleRoundtripWithLatency(b *testing.B) { + defer leaktest.AfterTest(b)() + defer log.Scope(b).Close(b) for _, latency := range []time.Duration{0, 10 * time.Millisecond} { b.Run(fmt.Sprintf("latency=%s", latency), func(b *testing.B) { var s localtestcluster.LocalTestCluster