SmoothRateLimiter.SmoothBursty obtaining too many permits without failure
chenzhiguo opened this issue · comments
chenzhiguo commented
Description
I wrote a test case, but the test result did not meet expectations.
Example
@Test
public void testTryAcquire_negative() {
RateLimiter limiter = RateLimiter.create(5.0);
Assertions.assertFalse(limiter.tryAcquire(5000, 0, SECONDS));
}
Expected Behavior
Test success!
Actual Behavior
Test fail!
Packages
com.google.common.util.concurrent
Platforms
Java 8
Checklist
- I agree to follow the code of conduct.
chenzhiguo commented
Okay, prefetching mode, first success, second failure