@@ -90,7 +90,7 @@ func (s *clientTestSuite) TestClientLeaderChange(c *C) {
90
90
cli := setupCli (c , s .ctx , endpoints )
91
91
92
92
var ts1 , ts2 uint64
93
- testutil .WaitUntil (c , func (c * C ) bool {
93
+ testutil .WaitUntil (c , func () bool {
94
94
p1 , l1 , err := cli .GetTS (context .TODO ())
95
95
if err == nil {
96
96
ts1 = tsoutil .ComposeTS (p1 , l1 )
@@ -111,7 +111,7 @@ func (s *clientTestSuite) TestClientLeaderChange(c *C) {
111
111
waitLeader (c , cli .(client ), cluster .GetServer (leader ).GetConfig ().ClientUrls )
112
112
113
113
// Check TS won't fall back after leader changed.
114
- testutil .WaitUntil (c , func (c * C ) bool {
114
+ testutil .WaitUntil (c , func () bool {
115
115
p2 , l2 , err := cli .GetTS (context .TODO ())
116
116
if err == nil {
117
117
ts2 = tsoutil .ComposeTS (p2 , l2 )
@@ -140,7 +140,7 @@ func (s *clientTestSuite) TestLeaderTransfer(c *C) {
140
140
cli := setupCli (c , s .ctx , endpoints )
141
141
142
142
var lastTS uint64
143
- testutil .WaitUntil (c , func (c * C ) bool {
143
+ testutil .WaitUntil (c , func () bool {
144
144
physical , logical , err := cli .GetTS (context .TODO ())
145
145
if err == nil {
146
146
lastTS = tsoutil .ComposeTS (physical , logical )
@@ -217,7 +217,7 @@ func (s *clientTestSuite) TestTSOAllocatorLeader(c *C) {
217
217
var allocatorLeaderMap = make (map [string ]string )
218
218
for _ , dcLocation := range dcLocationConfig {
219
219
var pdName string
220
- testutil .WaitUntil (c , func (c * C ) bool {
220
+ testutil .WaitUntil (c , func () bool {
221
221
pdName = cluster .WaitAllocatorLeader (dcLocation )
222
222
return len (pdName ) > 0
223
223
})
@@ -423,7 +423,7 @@ func (s *clientTestSuite) TestGetTsoFromFollowerClient1(c *C) {
423
423
424
424
c .Assert (failpoint .Enable ("github.com/tikv/pd/client/unreachableNetwork" , "return(true)" ), IsNil )
425
425
var lastTS uint64
426
- testutil .WaitUntil (c , func (c * C ) bool {
426
+ testutil .WaitUntil (c , func () bool {
427
427
physical , logical , err := cli .GetTS (context .TODO ())
428
428
if err == nil {
429
429
lastTS = tsoutil .ComposeTS (physical , logical )
@@ -451,7 +451,7 @@ func (s *clientTestSuite) TestGetTsoFromFollowerClient2(c *C) {
451
451
452
452
c .Assert (failpoint .Enable ("github.com/tikv/pd/client/unreachableNetwork" , "return(true)" ), IsNil )
453
453
var lastTS uint64
454
- testutil .WaitUntil (c , func (c * C ) bool {
454
+ testutil .WaitUntil (c , func () bool {
455
455
physical , logical , err := cli .GetTS (context .TODO ())
456
456
if err == nil {
457
457
lastTS = tsoutil .ComposeTS (physical , logical )
@@ -506,7 +506,7 @@ func setupCli(c *C, ctx context.Context, endpoints []string, opts ...pd.ClientOp
506
506
}
507
507
508
508
func waitLeader (c * C , cli client , leader string ) {
509
- testutil .WaitUntil (c , func (c * C ) bool {
509
+ testutil .WaitUntil (c , func () bool {
510
510
cli .ScheduleCheckLeader ()
511
511
return cli .GetLeaderAddr () == leader
512
512
})
@@ -721,7 +721,7 @@ func (s *testClientSuite) TestGetRegion(c *C) {
721
721
err := s .regionHeartbeat .Send (req )
722
722
c .Assert (err , IsNil )
723
723
724
- testutil .WaitUntil (c , func (c * C ) bool {
724
+ testutil .WaitUntil (c , func () bool {
725
725
r , err := s .client .GetRegion (context .Background (), []byte ("a" ))
726
726
c .Assert (err , IsNil )
727
727
if r == nil {
@@ -759,7 +759,7 @@ func (s *testClientSuite) TestGetPrevRegion(c *C) {
759
759
}
760
760
time .Sleep (500 * time .Millisecond )
761
761
for i := 0 ; i < 20 ; i ++ {
762
- testutil .WaitUntil (c , func (c * C ) bool {
762
+ testutil .WaitUntil (c , func () bool {
763
763
r , err := s .client .GetPrevRegion (context .Background (), []byte {byte (i )})
764
764
c .Assert (err , IsNil )
765
765
if i > 0 && i < regionLen {
@@ -798,7 +798,7 @@ func (s *testClientSuite) TestScanRegions(c *C) {
798
798
}
799
799
800
800
// Wait for region heartbeats.
801
- testutil .WaitUntil (c , func (c * C ) bool {
801
+ testutil .WaitUntil (c , func () bool {
802
802
scanRegions , err := s .client .ScanRegions (context .Background (), []byte {0 }, nil , 10 )
803
803
return err == nil && len (scanRegions ) == 10
804
804
})
@@ -865,7 +865,7 @@ func (s *testClientSuite) TestGetRegionByID(c *C) {
865
865
err := s .regionHeartbeat .Send (req )
866
866
c .Assert (err , IsNil )
867
867
868
- testutil .WaitUntil (c , func (c * C ) bool {
868
+ testutil .WaitUntil (c , func () bool {
869
869
r , err := s .client .GetRegionByID (context .Background (), regionID )
870
870
c .Assert (err , IsNil )
871
871
if r == nil {
@@ -1146,7 +1146,7 @@ func (s *testClientSuite) TestScatterRegion(c *C) {
1146
1146
err := s .regionHeartbeat .Send (req )
1147
1147
regionsID := []uint64 {regionID }
1148
1148
c .Assert (err , IsNil )
1149
- testutil .WaitUntil (c , func (c * C ) bool {
1149
+ testutil .WaitUntil (c , func () bool {
1150
1150
scatterResp , err := s .client .ScatterRegions (context .Background (), regionsID , pd .WithGroup ("test" ), pd .WithRetry (1 ))
1151
1151
if c .Check (err , NotNil ) {
1152
1152
return false
0 commit comments