flink-instrumentation/workspace/flink-1.4.1-instrumented/flink-1.4.1/flink-runtime/src/test/java/org/apache/flink/runtime/concurrent/FutureUtilsTest.java
/**
	 * Tests that a retry future is failed after all retries have been consumed.
	 */
Tests that a retry future is failed after all retries have been consumed.
Tests that a retry future is failed after all retries have been consumed .
@Test(expected = FutureUtils.RetryException.class)
	public void testRetryFailure() throws Throwable {
		final int retries = 3;
		CompletableFuture<?> retryFuture = FutureUtils.retry(
			() -> FutureUtils.completedExceptionally(new FlinkException("Test exception")),
			retries,
			TestingUtils.defaultExecutor());
		try {
			retryFuture.get();
		} catch (ExecutionException ee) {
			throw ExceptionUtils.stripExecutionException(ee);
		}
	}
@ Test ( expected = FutureUtils . RetryException . class ) public void testRetryFailure ( ) throws Throwable { final int retries = 3 ; CompletableFuture < ? > retryFuture = FutureUtils . retry ( ( ) -> FutureUtils . completedExceptionally ( new FlinkException ( "Test exception" ) ) , retries , TestingUtils . defaultExecutor ( ) ) ; try { retryFuture . get ( ) ; } catch ( ExecutionException ee ) { throw ExceptionUtils . stripExecutionException ( ee ) ; } }
Tests that a retry future is failed after all retries have been consumed.
Tests that a retry future is failed after all retries have been consumed .