Skip to content

Commit 9b8296b

Browse files
authored
*: migrate stale_txn tests to real tikv tests (#59589)
close #59588
1 parent 7a4c20e commit 9b8296b

File tree

4 files changed

+160
-96
lines changed

4 files changed

+160
-96
lines changed

pkg/executor/BUILD.bazel

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,6 @@ go_test(
372372
"slow_query_sql_test.go",
373373
"slow_query_test.go",
374374
"split_test.go",
375-
"stale_txn_test.go",
376375
"stmtsummary_test.go",
377376
"table_readers_required_rows_test.go",
378377
"temporary_table_test.go",
@@ -392,7 +391,6 @@ go_test(
392391
deps = [
393392
"//pkg/config",
394393
"//pkg/ddl",
395-
"//pkg/ddl/placement",
396394
"//pkg/ddl/util",
397395
"//pkg/distsql",
398396
"//pkg/distsql/context",
@@ -438,7 +436,6 @@ go_test(
438436
"//pkg/sessionctx/vardef",
439437
"//pkg/sessionctx/variable",
440438
"//pkg/sessiontxn",
441-
"//pkg/sessiontxn/staleread",
442439
"//pkg/statistics",
443440
"//pkg/statistics/handle/ddl/testutil",
444441
"//pkg/statistics/handle/storage",
@@ -493,7 +490,6 @@ go_test(
493490
"@com_github_pingcap_kvproto//pkg/brpb",
494491
"@com_github_pingcap_kvproto//pkg/diagnosticspb",
495492
"@com_github_pingcap_kvproto//pkg/encryptionpb",
496-
"@com_github_pingcap_kvproto//pkg/errorpb",
497493
"@com_github_pingcap_kvproto//pkg/keyspacepb",
498494
"@com_github_pingcap_kvproto//pkg/kvrpcpb",
499495
"@com_github_pingcap_kvproto//pkg/metapb",
@@ -509,7 +505,6 @@ go_test(
509505
"@com_github_tikv_client_go_v2//testutils",
510506
"@com_github_tikv_client_go_v2//tikv",
511507
"@com_github_tikv_client_go_v2//tikvrpc",
512-
"@com_github_tikv_client_go_v2//tikvrpc/interceptor",
513508
"@com_github_tikv_client_go_v2//util",
514509
"@com_github_tikv_pd_client//http",
515510
"@org_golang_google_grpc//:grpc",

pkg/sessiontxn/staleread/util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func CalculateAsOfTsExpr(ctx context.Context, sctx planctx.PlanContext, tsExpr a
5353
}
5454

5555
toTypeTimestamp := types.NewFieldType(mysql.TypeTimestamp)
56-
// We need at least the millionsecond here, so set fsp to 3.
56+
// We need at least the millisecond here, so set fsp to 3.
5757
toTypeTimestamp.SetDecimal(3)
5858
tsTimestamp, err := tsVal.ConvertTo(sctx.GetSessionVars().StmtCtx.TypeCtx(), toTypeTimestamp)
5959
if err != nil {

tests/realtikvtest/txntest/BUILD.bazel

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,38 @@ go_test(
66
srcs = [
77
"isolation_test.go",
88
"main_test.go",
9+
"stale_read_test.go",
910
"txn_state_test.go",
1011
"txn_test.go",
1112
],
1213
flaky = True,
1314
race = "on",
1415
deps = [
1516
"//pkg/config",
17+
"//pkg/ddl/placement",
1618
"//pkg/errno",
1719
"//pkg/expression",
1820
"//pkg/kv",
1921
"//pkg/parser",
2022
"//pkg/session/txninfo",
23+
"//pkg/sessiontxn",
24+
"//pkg/sessiontxn/staleread",
2125
"//pkg/store/driver",
2226
"//pkg/testkit",
2327
"//pkg/testkit/testfailpoint",
28+
"//pkg/types",
2429
"//pkg/util",
2530
"//pkg/util/sqlexec",
2631
"//tests/realtikvtest",
32+
"@com_github_docker_go_units//:go-units",
2733
"@com_github_pingcap_errors//:errors",
2834
"@com_github_pingcap_failpoint//:failpoint",
35+
"@com_github_pingcap_kvproto//pkg/errorpb",
36+
"@com_github_pingcap_kvproto//pkg/kvrpcpb",
2937
"@com_github_stretchr_testify//require",
38+
"@com_github_tikv_client_go_v2//oracle",
3039
"@com_github_tikv_client_go_v2//tikvrpc",
40+
"@com_github_tikv_client_go_v2//tikvrpc/interceptor",
3141
"@io_opencensus_go//stats/view",
3242
],
3343
)

0 commit comments

Comments
 (0)