HBASE-13974 TestRateLimiter#testFixedIntervalResourceAvailability may fail (Guanghao Zhang)

This commit is contained in:
tedyu 2015-06-26 08:27:06 -07:00
parent 130817b559
commit f046c4b043
1 changed files with 2 additions and 2 deletions

View File

@ -143,13 +143,13 @@ public class TestRateLimiter {
@Test
public void testFixedIntervalResourceAvailability() throws Exception {
RateLimiter limiter = new FixedIntervalRateLimiter();
limiter.set(10, TimeUnit.MILLISECONDS);
limiter.set(10, TimeUnit.SECONDS);
assertTrue(limiter.canExecute(10));
limiter.consume(3);
assertEquals(7, limiter.getAvailable());
assertFalse(limiter.canExecute(10));
limiter.setNextRefillTime(limiter.getNextRefillTime() - 3);
limiter.setNextRefillTime(limiter.getNextRefillTime() - 1000);
assertTrue(limiter.canExecute(10));
assertEquals(10, limiter.getAvailable());
}