diff --git a/ddl/concurrentddltest/BUILD.bazel b/ddl/concurrentddltest/BUILD.bazel index 82e2adf1fe9c2..61388f159390f 100644 --- a/ddl/concurrentddltest/BUILD.bazel +++ b/ddl/concurrentddltest/BUILD.bazel @@ -2,7 +2,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_test") go_test( name = "concurrentddltest_test", - timeout = "moderate", + timeout = "long", srcs = [ "main_test.go", "switch_test.go", diff --git a/executor/BUILD.bazel b/executor/BUILD.bazel index 7b1a4d603f993..0e2fbacf20f95 100644 --- a/executor/BUILD.bazel +++ b/executor/BUILD.bazel @@ -247,7 +247,7 @@ go_library( go_test( name = "executor_test", - timeout = "moderate", + timeout = "long", srcs = [ "adapter_test.go", "admin_test.go", diff --git a/session/BUILD.bazel b/session/BUILD.bazel index d0d68a9142035..be3c8699ee6c8 100644 --- a/session/BUILD.bazel +++ b/session/BUILD.bazel @@ -107,7 +107,7 @@ go_library( go_test( name = "session_test", - timeout = "short", + timeout = "moderate", srcs = [ "bench_test.go", "bootstrap_test.go", diff --git a/testkit/BUILD.bazel b/testkit/BUILD.bazel index 39cedb2ce0b53..4e0e24091db27 100644 --- a/testkit/BUILD.bazel +++ b/testkit/BUILD.bazel @@ -30,6 +30,7 @@ go_library( "//util/breakpoint", "//util/chunk", "//util/gctuner", + "//util/mathutil", "//util/sqlexec", "@com_github_pingcap_errors//:errors", "@com_github_pingcap_failpoint//:failpoint", diff --git a/testkit/testkit.go b/testkit/testkit.go index db86548ee3bfd..56e02fef5e688 100644 --- a/testkit/testkit.go +++ b/testkit/testkit.go @@ -19,6 +19,7 @@ package testkit import ( "context" "fmt" + "runtime" "strings" "sync" "testing" @@ -32,6 +33,7 @@ import ( "github.com/pingcap/tidb/session" "github.com/pingcap/tidb/sessionctx/variable" "github.com/pingcap/tidb/util/chunk" + "github.com/pingcap/tidb/util/mathutil" "github.com/pingcap/tidb/util/sqlexec" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -54,6 +56,7 @@ type TestKit struct { // NewTestKit returns a new *TestKit. func NewTestKit(t testing.TB, store kv.Storage) *TestKit { + runtime.GOMAXPROCS(mathutil.Min(16, runtime.GOMAXPROCS(0))) tk := &TestKit{ require: require.New(t), assert: assert.New(t),