RateLimitedQueue TestTryOrdering could fail under load
Remove the possibility of contention in the test by providing a synthetic Now() function.
This commit is contained in:
@@ -164,7 +164,7 @@ func (q *RateLimitedTimedQueue) Try(fn ActionFunc) {
|
||||
for ok {
|
||||
// rate limit the queue checking
|
||||
if !q.limiter.TryAccept() {
|
||||
glog.V(10).Info("Try rate limitted...")
|
||||
glog.V(10).Info("Try rate limited...")
|
||||
// Try again later
|
||||
break
|
||||
}
|
||||
|
Reference in New Issue
Block a user