Skip to content

Commit

Permalink
bazel: update config and enable race for part test (#38434)
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkingrei authored Oct 13, 2022
1 parent a840354 commit 4394a2a
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 14 deletions.
1 change: 1 addition & 0 deletions bindinfo/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ go_test(
],
embed = [":bindinfo"],
flaky = True,
race = "on",
shard_count = 50,
deps = [
"//config",
Expand Down
1 change: 1 addition & 0 deletions br/pkg/restore/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ go_test(
"//types",
"//util/codec",
"//util/mathutil",
"@com_github_fsouza_fake_gcs_server//fakestorage",
"@com_github_golang_protobuf//proto",
"@com_github_pingcap_errors//:errors",
"@com_github_pingcap_failpoint//:failpoint",
Expand Down
1 change: 1 addition & 0 deletions distsql/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ go_test(
],
embed = [":distsql"],
flaky = True,
race = "on",
deps = [
"//kv",
"//parser/charset",
Expand Down
1 change: 1 addition & 0 deletions domain/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ go_library(
"//util/execdetails",
"//util/expensivequery",
"//util/logutil",
"//util/memoryusagealarm",
"//util/servermemorylimit",
"//util/sqlexec",
"@com_github_ngaut_pools//:pools",
Expand Down
1 change: 1 addition & 0 deletions store/mockstore/unistore/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ go_library(
"@com_github_pingcap_kvproto//pkg/coprocessor",
"@com_github_pingcap_kvproto//pkg/debugpb",
"@com_github_pingcap_kvproto//pkg/errorpb",
"@com_github_pingcap_kvproto//pkg/keyspacepb",
"@com_github_pingcap_kvproto//pkg/kvrpcpb",
"@com_github_pingcap_kvproto//pkg/metapb",
"@com_github_pingcap_kvproto//pkg/mpp",
Expand Down
1 change: 1 addition & 0 deletions util/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ go_test(
"processinfo_test.go",
"security_test.go",
"urls_test.go",
"util_test.go",
"wait_group_wrapper_test.go",
],
data = glob(["tls_test/**"]),
Expand Down
14 changes: 1 addition & 13 deletions util/expensivequery/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,14 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "expensivequery",
srcs = [
"expensivequery.go",
"memory_usage_alarm.go",
],
srcs = ["expensivequery.go"],
importpath = "github.com/pingcap/tidb/util/expensivequery",
visibility = ["//visibility:public"],
deps = [
"//config",
"//parser",
"//sessionctx/variable",
"//util",
"//util/disk",
"//util/logutil",
"//util/memory",
"@com_github_pingcap_log//:log",
"@org_golang_x_exp//slices",
"@org_uber_go_zap//:zap",
"@org_uber_go_zap//zapcore",
],
Expand All @@ -30,11 +22,7 @@ go_test(
embed = [":expensivequery"],
flaky = True,
deps = [
"//sessionctx/stmtctx",
"//testkit/testsetup",
"//util",
"//util/memory",
"@com_github_stretchr_testify//assert",
"@org_uber_go_goleak//:goleak",
],
)
7 changes: 6 additions & 1 deletion util/gctuner/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ go_library(
srcs = [
"finalizer.go",
"mem.go",
"memory_limit_tuner.go",
"tuner.go",
],
importpath = "github.com/pingcap/tidb/util/gctuner",
visibility = ["//visibility:public"],
deps = [
"//util",
"//util/memory",
"@com_github_pingcap_failpoint//:failpoint",
"@org_uber_go_atomic//:atomic",
],
)
Expand All @@ -20,13 +23,15 @@ go_test(
srcs = [
"finalizer_test.go",
"mem_test.go",
"memory_limit_tuner_test.go",
"tuner_test.go",
],
embed = [":gctuner"],
flaky = True,
race = "on",
deps = [
"@com_github_stretchr_testify//assert",
"//util/memory",
"@com_github_pingcap_failpoint//:failpoint",
"@com_github_stretchr_testify//require",
],
)
34 changes: 34 additions & 0 deletions util/memoryusagealarm/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "memoryusagealarm",
srcs = ["memoryusagealarm.go"],
importpath = "github.com/pingcap/tidb/util/memoryusagealarm",
visibility = ["//visibility:public"],
deps = [
"//config",
"//sessionctx/variable",
"//util",
"//util/disk",
"//util/logutil",
"//util/memory",
"@org_golang_x_exp//slices",
"@org_uber_go_zap//:zap",
"@org_uber_go_zap//zapcore",
],
)

go_test(
name = "memoryusagealarm_test",
srcs = ["memoryusagealarm_test.go"],
embed = [":memoryusagealarm"],
flaky = True,
race = "on",
deps = [
"//sessionctx/stmtctx",
"//util",
"//util/execdetails",
"//util/memory",
"@com_github_stretchr_testify//assert",
],
)

0 comments on commit 4394a2a

Please sign in to comment.