Skip to content

Commit

Permalink
refine test
Browse files Browse the repository at this point in the history
Signed-off-by: Bin Shi <binshi.bing@gmail.com>
  • Loading branch information
binshi-bing committed May 4, 2023
1 parent 0758f20 commit 255d3e4
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions tests/integrations/tso/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,9 @@ func (suite *tsoClientTestSuite) TestGetTSAsync() {
var wg sync.WaitGroup
wg.Add(tsoRequestConcurrencyNumber)
for i := 0; i < tsoRequestConcurrencyNumber; i++ {
go func() {
defer wg.Done()

for _, client := range suite.clients {
for _, client := range suite.clients {
go func(client pd.Client) {
defer wg.Done()
tsFutures := make([]pd.TSFuture, tsoRequestRound)
for j := range tsFutures {
tsFutures[j] = client.GetTSAsync(suite.ctx)
Expand All @@ -186,8 +185,8 @@ func (suite *tsoClientTestSuite) TestGetTSAsync() {
suite.Greater(lastTS, ts)
lastTS = ts
}
}
}()
}(client)
}
}
wg.Wait()
}
Expand Down

0 comments on commit 255d3e4

Please sign in to comment.