flink-runtime/src/test/java/org/apache/flink/runtime/concurrent/FutureUtilsTest.java
/**
	 * Tests that retry with delay fails after having exceeded all retries.
	 */
Tests that retry with delay fails after having exceeded all retries.
Tests that retry with delay fails after having exceeded all retries .
@Test(expected = FutureUtils.RetryException.class)
	public void testRetryWithDelayFailure() throws Throwable {
		CompletableFuture<?> retryFuture = FutureUtils.retryWithDelay(
			() -> FutureUtils.completedExceptionally(new FlinkException("Test exception")),
			3,
			Time.milliseconds(1L),
			TestingUtils.defaultScheduledExecutor());
		try {
			retryFuture.get(TestingUtils.TIMEOUT().toMilliseconds(), TimeUnit.MILLISECONDS);
		} catch (ExecutionException ee) {
			throw ExceptionUtils.stripExecutionException(ee);
		}
	}
@ Test ( expected = FutureUtils . RetryException . class ) public void testRetryWithDelayFailure ( ) throws Throwable { CompletableFuture < ? > retryFuture = FutureUtils . retryWithDelay ( ( ) -> FutureUtils . completedExceptionally ( new FlinkException ( "Test exception" ) ) , 3 , Time . milliseconds ( 1L ) , TestingUtils . defaultScheduledExecutor ( ) ) ; try { retryFuture . get ( TestingUtils . TIMEOUT ( ) . toMilliseconds ( ) , TimeUnit . MILLISECONDS ) ; } catch ( ExecutionException ee ) { throw ExceptionUtils . stripExecutionException ( ee ) ; } }
Tests that retry with delay fails after having exceeded all retries.
Tests that retry with delay fails after having exceeded all retries .