Skip to content

Commit c927e10

Browse files
committed
bindinfo: avoid global benchmark result sink
1 parent 5b8ce84 commit c927e10

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

pkg/bindinfo/binding_operator_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package bindinfo_test
1717
import (
1818
"context"
1919
"fmt"
20+
"runtime"
2021
"sync"
2122
"testing"
2223
"time"
@@ -33,8 +34,6 @@ import (
3334
"github.com/stretchr/testify/require"
3435
)
3536

36-
var benchmarkNormalizeStmtForBindingResult string
37-
3837
func TestBindingCache(t *testing.T) {
3938
store, dom := testkit.CreateMockStoreAndDomain(t)
4039

@@ -961,7 +960,7 @@ func BenchmarkNormalizeStmtForBinding(b *testing.B) {
961960
for b.Loop() {
962961
normalized, _ = bindinfo.NormalizeStmtForBinding(stmt, "test", true)
963962
}
964-
benchmarkNormalizeStmtForBindingResult = normalized
963+
runtime.KeepAlive(normalized)
965964
})
966965
}
967966
}

0 commit comments

Comments
 (0)