Skip to content

Commit

Permalink
domain: fix unstable test TestAbnormalSessionPool (#36154)
Browse files Browse the repository at this point in the history
close #36153
  • Loading branch information
hawkingrei authored Jul 13, 2022
1 parent 28c9600 commit f282325
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
1 change: 0 additions & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ build --java_language_version=17
build --java_runtime_version=17
build --tool_java_language_version=17
build --tool_java_runtime_version=17
build --experimental_remote_cache_compression

run --color=yes
build:release --workspace_status_command=./build/print-workspace-status.sh --stamp
Expand Down
1 change: 1 addition & 0 deletions distsql/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ go_library(

go_test(
name = "distsql_test",
timeout = "short",
srcs = [
"bench_test.go",
"distsql_test.go",
Expand Down
6 changes: 2 additions & 4 deletions domain/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ func TestNormalSessionPool(t *testing.T) {
info, err1 := infosync.GlobalInfoSyncerInit(context.Background(), "t", func() uint64 { return 1 }, nil, true)
require.NoError(t, err1)
conf := config.GetGlobalConfig()
conf.Port = 0
conf.Status.StatusPort = 10045
conf.Socket = ""
svr, err := server.NewServer(conf, nil)
require.NoError(t, err)
svr.SetDomain(domain)
Expand Down Expand Up @@ -109,8 +108,7 @@ func TestAbnormalSessionPool(t *testing.T) {
info, err1 := infosync.GlobalInfoSyncerInit(context.Background(), "t", func() uint64 { return 1 }, nil, true)
require.NoError(t, err1)
conf := config.GetGlobalConfig()
conf.Port = 0
conf.Status.StatusPort = 10046
conf.Socket = ""
svr, err := server.NewServer(conf, nil)
require.NoError(t, err)
svr.SetDomain(domain)
Expand Down
1 change: 1 addition & 0 deletions domain/infosync/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ go_library(

go_test(
name = "infosync_test",
timeout = "short",
srcs = ["info_test.go"],
embed = [":infosync"],
flaky = True,
Expand Down
2 changes: 2 additions & 0 deletions domain/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ package domain_test
import (
"testing"

"github.com/pingcap/tidb/server"
"github.com/pingcap/tidb/testkit/testsetup"
"go.uber.org/goleak"
)

func TestMain(m *testing.M) {
server.RunInGoTest = true
testsetup.SetupForCommonTest()
opts := []goleak.Option{
goleak.IgnoreTopFunction("github.com/golang/glog.(*loggingT).flushDaemon"),
Expand Down

0 comments on commit f282325

Please sign in to comment.