use of org.apache.flink.runtime.util.TestingFatalErrorHandler in project flink by apache.
the class JobMasterServiceLeadershipRunnerTest method setup.
@Before
public void setup() {
leaderElectionService = new TestingLeaderElectionService();
jobResultStore = new EmbeddedJobResultStore();
fatalErrorHandler = new TestingFatalErrorHandler();
}
use of org.apache.flink.runtime.util.TestingFatalErrorHandler in project flink by apache.
the class ResourceManagerTest method setup.
@Before
public void setup() throws Exception {
highAvailabilityServices = new TestingHighAvailabilityServices();
highAvailabilityServices.setResourceManagerLeaderElectionService(new TestingLeaderElectionService());
testingFatalErrorHandler = new TestingFatalErrorHandler();
resourceManagerResourceId = ResourceID.generate();
}
use of org.apache.flink.runtime.util.TestingFatalErrorHandler in project flink by apache.
the class DispatcherTest method testFatalErrorIfRecoveredJobsCannotBeStarted.
/**
* Tests that the {@link Dispatcher} fails fatally if the recovered jobs cannot be started. See
* FLINK-9097.
*/
@Test
public void testFatalErrorIfRecoveredJobsCannotBeStarted() throws Exception {
final FlinkException testException = new FlinkException("Test exception");
jobMasterLeaderElectionService.isLeader(UUID.randomUUID());
final TestingJobMasterServiceLeadershipRunnerFactory jobManagerRunnerFactory = new TestingJobMasterServiceLeadershipRunnerFactory();
dispatcher = createTestingDispatcherBuilder().setJobManagerRunnerFactory(jobManagerRunnerFactory).setRecoveredJobs(Collections.singleton(JobGraphTestUtils.emptyJobGraph())).build();
dispatcher.start();
final TestingFatalErrorHandler fatalErrorHandler = testingFatalErrorHandlerResource.getFatalErrorHandler();
final TestingJobManagerRunner testingJobManagerRunner = jobManagerRunnerFactory.takeCreatedJobManagerRunner();
// Let the initialization of the JobManagerRunner fail
testingJobManagerRunner.completeResultFuture(JobManagerRunnerResult.forInitializationFailure(new ExecutionGraphInfo(ArchivedExecutionGraph.createSparseArchivedExecutionGraph(jobId, jobGraph.getName(), JobStatus.FAILED, testException, jobGraph.getCheckpointingSettings(), 1L)), testException));
final Throwable error = fatalErrorHandler.getErrorFuture().get(TIMEOUT.toMilliseconds(), TimeUnit.MILLISECONDS);
assertThat(ExceptionUtils.findThrowableWithMessage(error, testException.getMessage()).isPresent(), is(true));
fatalErrorHandler.clearError();
}
use of org.apache.flink.runtime.util.TestingFatalErrorHandler in project flink by apache.
the class DefaultDispatcherRunnerTest method setup.
@Before
public void setup() {
testingLeaderElectionService = new TestingLeaderElectionService();
testingFatalErrorHandler = new TestingFatalErrorHandler();
testingDispatcherLeaderProcessFactory = TestingDispatcherLeaderProcessFactory.defaultValue();
}
use of org.apache.flink.runtime.util.TestingFatalErrorHandler in project flink by apache.
the class DefaultDispatcherRunnerITCase method setup.
@Before
public void setup() {
dispatcherRunnerFactory = DefaultDispatcherRunnerFactory.createSessionRunner(SessionDispatcherFactory.INSTANCE);
jobGraph = createJobGraph();
dispatcherLeaderElectionService = new TestingLeaderElectionService();
fatalErrorHandler = new TestingFatalErrorHandler();
jobGraphStore = TestingJobGraphStore.newBuilder().build();
jobResultStore = new EmbeddedJobResultStore();
partialDispatcherServices = TestingPartialDispatcherServices.builder().withFatalErrorHandler(fatalErrorHandler).build(blobServerResource.getBlobServer(), new Configuration());
}
Aggregations