Skip to content

Commit 04c873a

Browse files
committed
fix race
1 parent 1a7be4e commit 04c873a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

internal/consumer/consumer_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,12 +201,11 @@ func (s *ConsumerTestSuite) TestStart() {
201201
} else {
202202
s.NoError(err)
203203
s.True(s.consumer.IsRunning())
204-
205-
// Clean up goroutines
206-
s.consumer.cancel()
207-
s.consumer.wg.Wait()
208204
}
209205

206+
// Clean up goroutines before asserting expectations
207+
s.consumer.cancel()
208+
s.consumer.wg.Wait()
210209
s.mockClient.AssertExpectations(s.T())
211210
})
212211
}

0 commit comments

Comments
 (0)