Skip to content

Commit

Permalink
fix(test): test timing error
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Hindess <mark.hindess@gmail.com>
  • Loading branch information
hindessm committed Aug 3, 2023
1 parent 2a5f0f6 commit ce9ee05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion broker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1484,8 +1484,8 @@ func Test_handleThrottledResponse(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
broker.metricRegistry = metrics.NewRegistry()
broker.brokerThrottleTime = broker.registerHistogram("throttle-time-in-ms")
broker.handleThrottledResponse(tt.response)
startTime := time.Now()
broker.handleThrottledResponse(tt.response)
broker.waitIfThrottled()
if tt.expectDelay {
if time.Since(startTime) < throttleTime {
Expand Down

0 comments on commit ce9ee05

Please sign in to comment.