From 4a795fed2abc90b783bfeb31b35b7c0451b6ff08 Mon Sep 17 00:00:00 2001 From: MyonKeminta Date: Wed, 25 Sep 2024 04:14:28 +0800 Subject: [PATCH] Fix lint Signed-off-by: MyonKeminta --- client/tso_dispatcher_test.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/client/tso_dispatcher_test.go b/client/tso_dispatcher_test.go index 2f7a1ef6e1e..f22823d9698 100644 --- a/client/tso_dispatcher_test.go +++ b/client/tso_dispatcher_test.go @@ -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) { @@ -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. @@ -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. @@ -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.