]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-20451 Extend reset time in RatioBasedRateLimitCheckerTest.
authorWojtek Wajerowicz <115081248+wojciech-wajerowicz-sonarsource@users.noreply.github.com>
Tue, 23 Jan 2024 09:37:50 +0000 (10:37 +0100)
committersonartech <sonartech@sonarsource.com>
Tue, 23 Jan 2024 20:04:15 +0000 (20:04 +0000)
server/sonar-alm-client/src/test/java/org/sonar/alm/client/RatioBasedRateLimitCheckerTest.java

index 39a85ff31deef2e1d4c631b00eee1a1790bfcfd5..b7d1b2aee8d678bac54a14b6951a673abf8cf5ab 100644 (file)
@@ -40,6 +40,7 @@ public class RatioBasedRateLimitCheckerTest {
   @Rule
   public LogTester logTester = new LogTester();
   private static final long MILLIS_BEFORE_RESET = 100L;
+  public static final int TIME_UNTIL_RESET = 2;
   RatioBasedRateLimitChecker ratioBasedRateLimitChecker = new RatioBasedRateLimitChecker();
 
   @DataProvider
@@ -62,7 +63,7 @@ public class RatioBasedRateLimitCheckerTest {
     ApplicationHttpClient.RateLimit record = mock();
     when(record.limit()).thenReturn(limit);
     when(record.remaining()).thenReturn(remaining);
-    when(record.reset()).thenReturn(System.currentTimeMillis() / 1000 + 1);
+    when(record.reset()).thenReturn(System.currentTimeMillis() / 1000 + TIME_UNTIL_RESET);
 
     long start = System.currentTimeMillis();
     boolean result = ratioBasedRateLimitChecker.checkRateLimit(record);