Skip to content

Commit

Permalink
fix test case
Browse files Browse the repository at this point in the history
  • Loading branch information
amyangfei committed Jun 4, 2021
1 parent 015f1e1 commit c01b492
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cdc/kv/token_region_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func (s *tokenRegionSuite) TestRouterWithMultiStores(c *check.C) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()

storeN := 10
storeN := 5
stores := make([]string, 0, storeN)
for i := 0; i < storeN; i++ {
stores = append(stores, fmt.Sprintf("store-%d", i))
Expand All @@ -138,7 +138,7 @@ func (s *tokenRegionSuite) TestRouterWithMultiStores(c *check.C) {
r := NewSizedRegionRouter(context.Background(), limit)

for _, store := range stores {
for j := 0; j < limit*5; j++ {
for j := 0; j < limit*2; j++ {
r.AddRegion(singleRegionInfo{ts: uint64(j), rpcCtx: &tikv.RPCContext{Addr: store}})
}
}
Expand All @@ -159,7 +159,7 @@ func (s *tokenRegionSuite) TestRouterWithMultiStores(c *check.C) {
r.Acquire(store)
atomic.AddUint64(&received, 1)
r.Release(store)
if atomic.LoadUint64(&received) == uint64(limit*10) {
if atomic.LoadUint64(&received) == uint64(limit*4*storeN) {
cancel()
}
}
Expand All @@ -168,7 +168,7 @@ func (s *tokenRegionSuite) TestRouterWithMultiStores(c *check.C) {
}

for _, store := range stores {
for i := 0; i < limit*5; i++ {
for i := 0; i < limit*2; i++ {
r.AddRegion(singleRegionInfo{ts: uint64(i), rpcCtx: &tikv.RPCContext{Addr: store}})
}
}
Expand Down

0 comments on commit c01b492

Please sign in to comment.