diff --git a/sdk-platform-java/gax-java/gax/src/test/java/com/google/api/gax/batching/FlowControllerTest.java b/sdk-platform-java/gax-java/gax/src/test/java/com/google/api/gax/batching/FlowControllerTest.java index a13d7704ee57..ce6c2779fed0 100644 --- a/sdk-platform-java/gax-java/gax/src/test/java/com/google/api/gax/batching/FlowControllerTest.java +++ b/sdk-platform-java/gax-java/gax/src/test/java/com/google/api/gax/batching/FlowControllerTest.java @@ -211,7 +211,7 @@ private static void testBlockingReserveRelease( assertFalse(finished.isDone()); flowController.release(1, 1); - finished.get(50, TimeUnit.MILLISECONDS); + finished.get(10, TimeUnit.SECONDS); flowController.release(maxElementCount, maxNumBytes); } @@ -524,7 +524,7 @@ void testConcurrentUpdateThresholds_blocking() throws Exception { testConcurrentUpdates( flowController, 100, 100, 10, totalIncreased, totalDecreased, releasedCounter); for (Future t : reserveThreads) { - t.get(200, TimeUnit.MILLISECONDS); + t.get(10, TimeUnit.SECONDS); } assertEquals(reserveThreads.size(), releasedCounter.get()); assertTrue(totalIncreased.get() > 0); @@ -557,7 +557,7 @@ void testConcurrentUpdateThresholds_nonBlocking() throws Exception { testConcurrentUpdates( flowController, 100, 100, 100, totalIncreased, totalDecreased, releasedCounter); for (Future t : reserveThreads) { - t.get(200, TimeUnit.MILLISECONDS); + t.get(10, TimeUnit.SECONDS); } assertEquals(reserveThreads.size(), releasedCounter.get()); assertTrue(totalIncreased.get() > 0); @@ -623,7 +623,7 @@ void testNumberOfBytesOutOfBoundaryWontDeadlock() throws Exception { } @Test - @Timeout(value = 500, unit = TimeUnit.MILLISECONDS) + @Timeout(value = 10, unit = TimeUnit.SECONDS) void testElementCountsOutOfBoundaryWontDeadlock() throws Exception { // Test the special case where in FlowController#reserve, to avoid deadlocks, it allows // reserving byte size greater than current request bytes limit. @@ -773,7 +773,7 @@ private List> testConcurrentUpdates( reserveReleaseFuture.add(reserveExecutor.submit(reserveReleaseRunnable)); } for (Future t : updateFuture) { - t.get(50, TimeUnit.MILLISECONDS); + t.get(10, TimeUnit.SECONDS); } executors.shutdown(); return reserveReleaseFuture;