use of org.apache.flink.runtime.operators.coordination.MockOperatorCoordinatorContext in project flink by apache.
the class SourceCoordinatorProviderTest method testCallAsyncExceptionFailsJob.
@Test
public void testCallAsyncExceptionFailsJob() throws Exception {
MockOperatorCoordinatorContext context = new MockOperatorCoordinatorContext(OPERATOR_ID, NUM_SPLITS);
RecreateOnResetOperatorCoordinator coordinator = (RecreateOnResetOperatorCoordinator) provider.create(context);
SourceCoordinator<?, ?> sourceCoordinator = (SourceCoordinator<?, ?>) coordinator.getInternalCoordinator();
sourceCoordinator.getContext().callAsync(() -> null, (ignored, e) -> {
throw new RuntimeException();
});
CommonTestUtils.waitUtil(context::isJobFailed, Duration.ofSeconds(10L), "The job did not fail before timeout.");
}
Aggregations