Skip to content

Commit

Permalink
Added throttling limitation
Browse files Browse the repository at this point in the history
Signed-off-by: vhnes <ext-vladyslav.hnes@here.com>
  • Loading branch information
VladyslavHnes committed May 14, 2024
1 parent 4f96dad commit 6a0cfb2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void testClientThrottling() {
AtomicInteger tooManyRequestsCount = new AtomicInteger(0);
ExecutorService executorService = newFixedThreadPool(20);

CompletableFuture<?>[] futures = IntStream.range(0, 15)
CompletableFuture<?>[] futures = IntStream.range(0, 10)
.mapToObj(i -> CompletableFuture.runAsync(() ->
{
try {
Expand All @@ -59,7 +59,7 @@ public void testClientThrottling() {

CompletableFuture.allOf(futures).join();
assertEquals(7, successfulCount.get());
assertEquals(8, tooManyRequestsCount.get());
assertEquals(3, tooManyRequestsCount.get());
}

private HttpResponse<String> getIterateSpace(String spaceId, AuthProfile profile) throws IOException, InterruptedException {
Expand Down

0 comments on commit 6a0cfb2

Please sign in to comment.