Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: move more tests to integration test #48647

Merged
merged 13 commits into from
Nov 17, 2023
Merged
2 changes: 1 addition & 1 deletion pkg/executor/test/simpletest/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ go_test(
],
flaky = True,
race = "on",
shard_count = 12,
shard_count = 11,
deps = [
"//pkg/config",
"//pkg/parser/auth",
Expand Down
31 changes: 0 additions & 31 deletions pkg/executor/test/simpletest/simple_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,37 +37,6 @@ import (
"go.opencensus.io/stats/view"
)

func TestStmtAutoNewTxn(t *testing.T) {
store := testkit.CreateMockStore(t)
// Some statements are like DDL, they commit the previous txn automically.
tk := testkit.NewTestKit(t, store)
tk.MustExec("use test")

// Fix issue https://github.com/pingcap/tidb/issues/10705
tk.MustExec("begin")
tk.MustExec("create user 'xxx'@'%';")
tk.MustExec("grant all privileges on *.* to 'xxx'@'%';")

tk.MustExec("create table auto_new (id int)")
tk.MustExec("begin")
tk.MustExec("insert into auto_new values (1)")
tk.MustExec("revoke all privileges on *.* from 'xxx'@'%'")
tk.MustExec("rollback") // insert statement has already committed
tk.MustQuery("select * from auto_new").Check(testkit.Rows("1"))

// Test the behavior when autocommit is false.
tk.MustExec("set autocommit = 0")
tk.MustExec("insert into auto_new values (2)")
tk.MustExec("create user 'yyy'@'%'")
tk.MustExec("rollback")
tk.MustQuery("select * from auto_new").Check(testkit.Rows("1", "2"))

tk.MustExec("drop user 'yyy'@'%'")
tk.MustExec("insert into auto_new values (3)")
tk.MustExec("rollback")
tk.MustQuery("select * from auto_new").Check(testkit.Rows("1", "2"))
}

func TestExtendedStatsPrivileges(t *testing.T) {
store := testkit.CreateMockStore(t)
tk := testkit.NewTestKit(t, store)
Expand Down
2 changes: 1 addition & 1 deletion pkg/expression/test/multivaluedindex/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ go_test(
"multi_valued_index_test.go",
],
flaky = True,
shard_count = 6,
shard_count = 4,
deps = [
"//pkg/config",
"//pkg/errno",
Expand Down
205 changes: 0 additions & 205 deletions pkg/expression/test/multivaluedindex/multi_valued_index_test.go

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion pkg/planner/core/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ go_test(
"enforce_mpp_test.go",
"errors_test.go",
"exhaust_physical_plans_test.go",
"expression_rewriter_test.go",
"expression_test.go",
"find_best_task_test.go",
"fragment_test.go",
Expand Down
3 changes: 1 addition & 2 deletions pkg/planner/core/casetest/physicalplantest/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ go_test(
data = glob(["testdata/**"]),
flaky = True,
race = "on",
shard_count = 50,
shard_count = 30,
deps = [
"//pkg/config",
"//pkg/domain",
Expand All @@ -23,7 +23,6 @@ go_test(
"//pkg/planner/core",
"//pkg/planner/core/internal",
"//pkg/sessionctx/stmtctx",
"//pkg/sessionctx/variable",
"//pkg/testkit",
"//pkg/testkit/external",
"//pkg/testkit/testdata",
Expand Down
Loading