session: stabilize test TestBatchCommit (#18625)

Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>
This commit is contained in:
wjHuang
2020-07-16 12:52:18 +08:00
committed by GitHub
parent 38621d29aa
commit 2a5fb55194

View File

@ -523,6 +523,10 @@ func (s *testPessimisticSuite) TestAsyncRollBackNoWait(c *C) {
// the txn correctness should be ensured
c.Assert(failpoint.Enable("github.com/pingcap/tidb/executor/ExecStmtGetTsError", "return"), IsNil)
c.Assert(failpoint.Enable("github.com/pingcap/tidb/store/tikv/AsyncRollBackSleep", "return"), IsNil)
defer func() {
c.Assert(failpoint.Disable("github.com/pingcap/tidb/executor/ExecStmtGetTsError"), IsNil)
c.Assert(failpoint.Disable("github.com/pingcap/tidb/store/tikv/AsyncRollBackSleep"), IsNil)
}()
tk.MustExec("begin pessimistic")
tk.MustExec("select * from tk where c1 > 0 for update nowait")
tk2.MustExec("begin pessimistic")
@ -549,8 +553,6 @@ func (s *testPessimisticSuite) TestAsyncRollBackNoWait(c *C) {
tk3.MustQuery("select * from tk where c1 = 4 for update nowait").Check(testkit.Rows("4 4"))
tk3.MustQuery("select * from tk where c1 = 3 for update nowait").Check(testkit.Rows("3 3"))
tk3.MustExec("commit")
c.Assert(failpoint.Disable("github.com/pingcap/tidb/executor/ExecStmtGetTsError"), IsNil)
c.Assert(failpoint.Disable("github.com/pingcap/tidb/store/tikv/AsyncRollBackSleep"), IsNil)
}
func (s *testPessimisticSuite) TestWaitLockKill(c *C) {