Skip to content

Commit

Permalink
make lint happy
Browse files Browse the repository at this point in the history
Signed-off-by: Yilin Chen <[email protected]>
  • Loading branch information
sticnarf committed Feb 24, 2021
1 parent e05ef4d commit 640b540
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 7 additions & 2 deletions session/session_fail_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,15 @@ func (s *testSessionSerialSuite) TestAutoCommitNeedNotLinearizability(c *C) {
tk.MustExec(`create table t1 (c int)`)

c.Assert(failpoint.Enable("github.com/pingcap/tidb/store/tikv/getMinCommitTSFromTSO", `panic`), IsNil)
defer failpoint.Disable("github.com/pingcap/tidb/store/tikv/getMinCommitTSFromTSO")
defer func() {
c.Assert(failpoint.Disable("github.com/pingcap/tidb/store/tikv/getMinCommitTSFromTSO"), IsNil)
}()

tk.Se.GetSessionVars().SetSystemVar("tidb_enable_async_commit", "1")
c.Assert(tk.Se.GetSessionVars().SetSystemVar("tidb_enable_async_commit", "1"), IsNil)
tk.Se.GetSessionVars().SetSystemVar("tidb_guarantee_linearizability", "1")
c.Assert(tk.Se.GetSessionVars().SetSystemVar("tidb_guarantee_linearizability", "1"), IsNil)

// Auto-commit transactions don't need to get minCommitTS from TSO
tk.MustExec("INSERT INTO t1 VALUES (1)")

Expand All @@ -141,7 +146,7 @@ func (s *testSessionSerialSuite) TestAutoCommitNeedNotLinearizability(c *C) {

// Same for 1PC
tk.MustExec("set autocommit = 1")
tk.Se.GetSessionVars().SetSystemVar("tidb_enable_1pc", "1")
c.Assert(tk.Se.GetSessionVars().SetSystemVar("tidb_enable_1pc", "1"), IsNil)
tk.MustExec("INSERT INTO t1 VALUES (4)")

tk.MustExec("BEGIN")
Expand Down
3 changes: 2 additions & 1 deletion store/gcworker/gc_worker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -924,10 +924,11 @@ func (s *testGCWorkerSuite) TestResolveLockRangeMeetRegionEnlargeCausedByRegionM
mCluster := s.cluster.(*mocktikv.Cluster)
mCluster.Merge(s.initRegion.regionID, region2)
regionMeta, _ := mCluster.GetRegion(s.initRegion.regionID)
s.tikvStore.GetRegionCache().OnRegionEpochNotMatch(
err := s.tikvStore.GetRegionCache().OnRegionEpochNotMatch(
tikv.NewNoopBackoff(context.Background()),
&tikv.RPCContext{Region: regionID, Store: &tikv.Store{}},
[]*metapb.Region{regionMeta})
c.Assert(err, IsNil)
// also let region1 contains all 4 locks
s.gcWorker.testingKnobs.scanLocks = func(key []byte, regionID uint64) []*tikv.Lock {
if regionID == s.initRegion.regionID {
Expand Down

0 comments on commit 640b540

Please sign in to comment.