Skip to content

Commit

Permalink
*: enable more flaky test, enable more shard_count and update bazel c…
Browse files Browse the repository at this point in the history
…onfig (#35300)

ref #35247
  • Loading branch information
hawkingrei committed Jun 13, 2022
1 parent b91bdd0 commit d3e9114
Show file tree
Hide file tree
Showing 30 changed files with 4,346 additions and 4,147 deletions.
4 changes: 4 additions & 0 deletions br/pkg/lightning/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ go_library(
"//br/pkg/lightning/config",
"//br/pkg/lightning/glue",
"//br/pkg/lightning/log",
"//br/pkg/lightning/metric",
"//br/pkg/lightning/mydump",
"//br/pkg/lightning/restore",
"//br/pkg/lightning/tikv",
Expand All @@ -25,9 +26,12 @@ go_library(
"//br/pkg/storage",
"//br/pkg/utils",
"//br/pkg/version/build",
"//util/promutil",
"@com_github_pingcap_errors//:errors",
"@com_github_pingcap_failpoint//:failpoint",
"@com_github_pingcap_kvproto//pkg/import_sstpb",
"@com_github_prometheus_client_golang//prometheus",
"@com_github_prometheus_client_golang//prometheus/collectors",
"@com_github_prometheus_client_golang//prometheus/promhttp",
"@com_github_shurcool_httpgzip//:httpgzip",
"@org_uber_go_zap//:zap",
Expand Down
3 changes: 3 additions & 0 deletions br/pkg/lightning/metric/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ go_library(
importpath = "github.com/pingcap/tidb/br/pkg/lightning/metric",
visibility = ["//visibility:public"],
deps = [
"//util/promutil",
"@com_github_prometheus_client_golang//prometheus",
"@com_github_prometheus_client_model//go",
],
Expand All @@ -16,7 +17,9 @@ go_test(
srcs = ["metric_test.go"],
deps = [
":metric",
"//util/promutil",
"@com_github_prometheus_client_golang//prometheus",
"@com_github_stretchr_testify//assert",
"@com_github_stretchr_testify//require",
],
)
1 change: 1 addition & 0 deletions br/pkg/lightning/restore/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ go_test(
"//types",
"//util",
"//util/mock",
"//util/promutil",
"//util/table-filter",
"@com_github_data_dog_go_sqlmock//:go-sqlmock",
"@com_github_docker_go_units//:go-units",
Expand Down
7 changes: 3 additions & 4 deletions ddl/cancel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"github.com/pingcap/tidb/errno"
"github.com/pingcap/tidb/parser/model"
"github.com/pingcap/tidb/testkit"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
atomicutil "go.uber.org/atomic"
)
Expand All @@ -46,17 +45,17 @@ func testMatchCancelState(t *testing.T, job *model.Job, cancelState interface{},
case model.SchemaState:
if job.Type == model.ActionMultiSchemaChange {
msg := fmt.Sprintf("unexpected multi-schema change(sql: %s, cancel state: %s)", sql, v)
assert.Failf(t, msg, "use []model.SchemaState as cancel states instead")
require.Failf(t, msg, "use []model.SchemaState as cancel states instead")
return false
}
return job.SchemaState == v
case subStates: // For multi-schema change sub-jobs.
if job.MultiSchemaInfo == nil {
msg := fmt.Sprintf("not multi-schema change(sql: %s, cancel state: %v)", sql, v)
assert.Failf(t, msg, "use model.SchemaState as the cancel state instead")
require.Failf(t, msg, "use model.SchemaState as the cancel state instead")
return false
}
assert.Equal(t, len(job.MultiSchemaInfo.SubJobs), len(v), sql)
require.Equal(t, len(job.MultiSchemaInfo.SubJobs), len(v), sql)
for i, subJobSchemaState := range v {
if job.MultiSchemaInfo.SubJobs[i].SchemaState != subJobSchemaState {
return false
Expand Down
3 changes: 1 addition & 2 deletions ddl/column_change_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import (
"github.com/pingcap/tidb/testkit/external"
"github.com/pingcap/tidb/types"
"github.com/pingcap/tidb/util/mock"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

Expand Down Expand Up @@ -103,7 +102,7 @@ func TestColumnAdd(t *testing.T) {
tbl := external.GetTableByName(t, internal, "test", "t")
if job.SchemaState != model.StatePublic {
for _, col := range tbl.Cols() {
assert.NotEqualf(t, col.ID, dropCol.ID, "column is not dropped")
require.NotEqualf(t, col.ID, dropCol.ID, "column is not dropped")
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion distsql/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ go_library(
"distsql.go",
"request_builder.go",
"select_result.go",
"stream.go",
],
importpath = "github.com/pingcap/tidb/distsql",
visibility = ["//visibility:public"],
Expand Down Expand Up @@ -62,6 +61,7 @@ go_test(
"select_result_test.go",
],
embed = [":distsql"],
flaky = True,
deps = [
"//kv",
"//parser/charset",
Expand Down
7 changes: 6 additions & 1 deletion executor/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ go_library(
"admin_telemetry.go",
"aggregate.go",
"analyze.go",
"analyze_col.go",
"analyze_fast.go",
"analyze_global_stats.go",
"analyze_idx.go",
"analyze_incremental.go",
"analyze_utils.go",
"apply_cache.go",
"batch_checker.go",
"batch_point_get.go",
Expand Down Expand Up @@ -297,7 +303,6 @@ go_test(
"slow_query_sql_test.go",
"slow_query_test.go",
"sort_test.go",
"split_table_test.go",
"split_test.go",
"stale_txn_test.go",
"statement_context_test.go",
Expand Down
Loading

0 comments on commit d3e9114

Please sign in to comment.