Skip to content

Commit

Permalink
fix: check failpoints
Browse files Browse the repository at this point in the history
Signed-off-by: ekexium <[email protected]>
  • Loading branch information
ekexium committed Jul 24, 2024
1 parent 5a5ed93 commit 449b84e
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions pkg/session/bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import (
"github.com/pingcap/tidb/pkg/util/chunk"
"github.com/pingcap/tidb/pkg/util/logutil"
"github.com/pingcap/tidb/pkg/util/sqlexec"
"github.com/stretchr/testify/require"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
Expand Down Expand Up @@ -1950,8 +1951,8 @@ var batchNum = 100
var batchSize = 100

func BenchmarkPipelinedSimpleInsert(b *testing.B) {
failpoint.Enable("tikvclient/pipelinedSkipResolveLock", "return")
defer failpoint.Disable("tikvclient/pipelinedSkipResolveLock")
require.NoError(b, failpoint.Enable("tikvclient/pipelinedSkipResolveLock", "return"))
defer require.NoError(b, failpoint.Disable("tikvclient/pipelinedSkipResolveLock"))
logutil.InitLogger(&logutil.LogConfig{Config: log.Config{Level: "fatal"}})
se, do, st := prepareBenchSession()
defer func() {
Expand Down Expand Up @@ -1980,8 +1981,8 @@ func BenchmarkPipelinedSimpleInsert(b *testing.B) {
}

func BenchmarkPipelinedInsertIgnoreNoDuplicates(b *testing.B) {
failpoint.Enable("tikvclient/pipelinedSkipResolveLock", "return")
defer failpoint.Disable("tikvclient/pipelinedSkipResolveLock")
require.NoError(b, failpoint.Enable("tikvclient/pipelinedSkipResolveLock", "return"))
defer require.NoError(b, failpoint.Disable("tikvclient/pipelinedSkipResolveLock"))
logutil.InitLogger(&logutil.LogConfig{Config: log.Config{Level: "fatal"}})
se, do, st := prepareBenchSession()
defer func() {
Expand Down Expand Up @@ -2011,8 +2012,8 @@ func BenchmarkPipelinedInsertIgnoreNoDuplicates(b *testing.B) {
}

func BenchmarkPipelinedInsertOnDuplicate(b *testing.B) {
failpoint.Enable("tikvclient/pipelinedSkipResolveLock", "return")
defer failpoint.Disable("tikvclient/pipelinedSkipResolveLock")
require.NoError(b, failpoint.Enable("tikvclient/pipelinedSkipResolveLock", "return"))
defer require.NoError(b, failpoint.Disable("tikvclient/pipelinedSkipResolveLock"))
logutil.InitLogger(&logutil.LogConfig{Config: log.Config{Level: "fatal"}})
se, do, st := prepareBenchSession()
defer func() {
Expand Down Expand Up @@ -2047,8 +2048,8 @@ func BenchmarkPipelinedInsertOnDuplicate(b *testing.B) {
}

func BenchmarkPipelinedDelete(b *testing.B) {
failpoint.Enable("tikvclient/pipelinedSkipResolveLock", "return")
defer failpoint.Disable("tikvclient/pipelinedSkipResolveLock")
require.NoError(b, failpoint.Enable("tikvclient/pipelinedSkipResolveLock", "return"))
defer require.NoError(b, failpoint.Disable("tikvclient/pipelinedSkipResolveLock"))
logutil.InitLogger(&logutil.LogConfig{Config: log.Config{Level: "fatal"}})
se, do, st := prepareBenchSession()
defer func() {
Expand Down Expand Up @@ -2081,8 +2082,8 @@ func BenchmarkPipelinedDelete(b *testing.B) {
}

func BenchmarkPipelinedReplaceNoDuplicates(b *testing.B) {
failpoint.Enable("tikvclient/pipelinedSkipResolveLock", "return")
defer failpoint.Disable("tikvclient/pipelinedSkipResolveLock")
require.NoError(b, failpoint.Enable("tikvclient/pipelinedSkipResolveLock", "return"))
defer require.NoError(b, failpoint.Disable("tikvclient/pipelinedSkipResolveLock"))
logutil.InitLogger(&logutil.LogConfig{Config: log.Config{Level: "fatal"}})
se, do, st := prepareBenchSession()
defer func() {
Expand Down

0 comments on commit 449b84e

Please sign in to comment.