Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
MyonKeminta committed Apr 13, 2023
1 parent d573a97 commit 59c37c5
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions tests/realtikvtest/pessimistictest/pessimistic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3401,8 +3401,8 @@ func TestIssue42937(t *testing.T) {
tk2.MustExec("set @@tidb_enable_1pc = 0")
tk3.MustExec("use test")

tk.MustExec("create table t(id int primary key, v int unique, v2 int, index(v, v2))")
tk.MustExec("insert into t values (1, 10, 10), (2, 20, 20), (3, 30, 30), (4, 40, 40)")
tk.MustExec("create table t(id int primary key, v int unique)")
tk.MustExec("insert into t values (1, 10), (2, 20), (3, 30), (4, 40)")
tk.MustExec("create table t2 (id int primary key, v int)")
tk.MustExec("insert into t2 values (1, 1), (2, 2)")

Expand Down Expand Up @@ -3444,17 +3444,18 @@ func TestIssue42937(t *testing.T) {
require.NoError(t, failpoint.Disable("tikvclient/twoPCShortLockTTL"))
require.NoError(t, failpoint.Disable("tikvclient/shortPessimisticLockTTL"))

tk2.MustExec("insert into t values (5, 11, 50)")
tk2.MustExec("insert into t values (5, 11)")

time.Sleep(time.Second * 5)

// tk is supposed to fail to keep the consistency
mustRecv(t, ch)
tk.MustExec("admin check table t")
tk.MustQuery("select * from t order by id").Check(testkit.Rows(
"1 0 10",
"2 21 21",
"3 31 30",
"4 41 40",
"1 0",
"2 21",
"3 31",
"4 41",
"5 11",
))
}

0 comments on commit 59c37c5

Please sign in to comment.