use of org.apache.flink.streaming.api.operators.OperatorSnapshotFutures in project flink by apache.
the class AsyncCheckpointRunnableTest method testAsyncCheckpointException.
private void testAsyncCheckpointException(boolean isTaskRunning) {
final Map<OperatorID, OperatorSnapshotFutures> snapshotsInProgress = new HashMap<>();
snapshotsInProgress.put(new OperatorID(), new OperatorSnapshotFutures(ExceptionallyDoneFuture.of(new RuntimeException("Async Checkpoint Exception")), DoneFuture.of(SnapshotResult.empty()), DoneFuture.of(SnapshotResult.empty()), DoneFuture.of(SnapshotResult.empty()), DoneFuture.of(SnapshotResult.empty()), DoneFuture.of(SnapshotResult.empty())));
final TestEnvironment environment = new TestEnvironment();
final AsyncCheckpointRunnable runnable = createAsyncRunnable(snapshotsInProgress, environment, false, isTaskRunning);
runnable.run();
if (isTaskRunning) {
Assert.assertSame(environment.getCause().getCheckpointFailureReason(), CheckpointFailureReason.CHECKPOINT_ASYNC_EXCEPTION);
} else {
Assert.assertNull(environment.getCause());
}
}
Aggregations