Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: MyonKeminta <[email protected]>
  • Loading branch information
MyonKeminta committed Sep 24, 2024
1 parent 708bbe9 commit 4a795fe
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions client/tso_dispatcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func (s *testTSODispatcherSuite) checkIdleTokenCount(expectedTotal int) {
}
}
s.re.Equal(expectedTotal, s.dispatcher.tokenCount)
s.re.Equal(expectedTotal-1, len(s.dispatcher.tokenCh))
s.re.Len(s.dispatcher.tokenCh, expectedTotal-1)
}

func (s *testTSODispatcherSuite) testStaticConcurrencyImpl(concurrency int) {
Expand All @@ -200,7 +200,7 @@ func (s *testTSODispatcherSuite) testStaticConcurrencyImpl(concurrency int) {

// Make sure the state of the mock stream is clear. Unexpected batching may make the requests sent to the stream
// less than expected, causing there are more `generateNext` signals or generated results.
s.re.Equal(0, len(s.streamInner.resultCh))
s.re.Empty(s.streamInner.resultCh)

// The dispatcher may block on fetching requests, which is after checking concurrency option. Perform a request
// to make sure the concurrency setting takes effect.
Expand Down Expand Up @@ -229,7 +229,6 @@ func (s *testTSODispatcherSuite) testStaticConcurrencyImpl(concurrency int) {
reqs = append(reqs, req)
}

//time.Sleep(time.Hour)
// The dispatcher won't process more request batches if tokens are used up.
// Note that `reqMustNotReady` contains a delay, which makes it nearly impossible that dispatcher is processing the
// second batch but not finished yet.
Expand All @@ -251,7 +250,7 @@ func (s *testTSODispatcherSuite) testStaticConcurrencyImpl(concurrency int) {
break
}
}
s.re.Equal(expectedPending, len(s.stream.pendingRequests))
s.re.Len(s.stream.pendingRequests, expectedPending)

req := reqs[i]
// The last 3 requests should be in a single batch. Don't need to generate new results for the last 2.
Expand Down

0 comments on commit 4a795fe

Please sign in to comment.