Skip to content

Commit

Permalink
executor: make TestSplitRegionTimeout stable (#13152)
Browse files Browse the repository at this point in the history
  • Loading branch information
SunRunAway authored and sre-bot committed Nov 6, 2019
1 parent 8d545a1 commit aaaf254
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions store/tikv/split_region.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"bytes"
"context"
"math"
"time"

"github.com/pingcap/errors"
"github.com/pingcap/failpoint"
Expand Down Expand Up @@ -110,7 +109,9 @@ func (s *tikvStore) splitBatchRegionsReq(bo *Backoffer, keys [][]byte, scatter b
func (s *tikvStore) batchSendSingleRegion(bo *Backoffer, batch batch, scatter bool) singleBatchResp {
failpoint.Inject("MockSplitRegionTimeout", func(val failpoint.Value) {
if val.(bool) {
time.Sleep(time.Second*1 + time.Millisecond*10)
if _, ok := bo.ctx.Deadline(); ok {
<-bo.ctx.Done()
}
}
})

Expand Down

0 comments on commit aaaf254

Please sign in to comment.