Search in sources :

Example 16 with TestingFatalErrorHandler

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();
}
Also used : TestingFatalErrorHandler(org.apache.flink.runtime.util.TestingFatalErrorHandler) TestingLeaderElectionService(org.apache.flink.runtime.leaderelection.TestingLeaderElectionService) EmbeddedJobResultStore(org.apache.flink.runtime.highavailability.nonha.embedded.EmbeddedJobResultStore) Before(org.junit.Before)

Example 17 with 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();
}
Also used : TestingFatalErrorHandler(org.apache.flink.runtime.util.TestingFatalErrorHandler) TestingHighAvailabilityServices(org.apache.flink.runtime.highavailability.TestingHighAvailabilityServices) TestingLeaderElectionService(org.apache.flink.runtime.leaderelection.TestingLeaderElectionService) Before(org.junit.Before)

Example 18 with TestingFatalErrorHandler

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();
}
Also used : TestingFatalErrorHandler(org.apache.flink.runtime.util.TestingFatalErrorHandler) ExecutionGraphInfo(org.apache.flink.runtime.scheduler.ExecutionGraphInfo) TestingJobManagerRunner(org.apache.flink.runtime.jobmaster.TestingJobManagerRunner) FlinkException(org.apache.flink.util.FlinkException) Test(org.junit.Test)

Example 19 with TestingFatalErrorHandler

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();
}
Also used : TestingFatalErrorHandler(org.apache.flink.runtime.util.TestingFatalErrorHandler) TestingLeaderElectionService(org.apache.flink.runtime.leaderelection.TestingLeaderElectionService) Before(org.junit.Before)

Example 20 with TestingFatalErrorHandler

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());
}
Also used : TestingFatalErrorHandler(org.apache.flink.runtime.util.TestingFatalErrorHandler) TestingLeaderElectionService(org.apache.flink.runtime.leaderelection.TestingLeaderElectionService) Configuration(org.apache.flink.configuration.Configuration) EmbeddedJobResultStore(org.apache.flink.runtime.highavailability.nonha.embedded.EmbeddedJobResultStore) Before(org.junit.Before)

Aggregations

TestingFatalErrorHandler (org.apache.flink.runtime.util.TestingFatalErrorHandler)24 Test (org.junit.Test)15 Configuration (org.apache.flink.configuration.Configuration)12 TestingHighAvailabilityServices (org.apache.flink.runtime.highavailability.TestingHighAvailabilityServices)11 Before (org.junit.Before)10 JobID (org.apache.flink.api.common.JobID)8 HeartbeatServices (org.apache.flink.runtime.heartbeat.HeartbeatServices)8 TestingLeaderElectionService (org.apache.flink.runtime.leaderelection.TestingLeaderElectionService)7 AllocationID (org.apache.flink.runtime.clusterframework.types.AllocationID)6 ResourceID (org.apache.flink.runtime.clusterframework.types.ResourceID)6 UUID (java.util.UUID)5 CompletableFuture (java.util.concurrent.CompletableFuture)5 Time (org.apache.flink.api.common.time.Time)5 SettableLeaderRetrievalService (org.apache.flink.runtime.leaderretrieval.SettableLeaderRetrievalService)5 TaskManagerLocation (org.apache.flink.runtime.taskmanager.TaskManagerLocation)5 StandaloneCheckpointRecoveryFactory (org.apache.flink.runtime.checkpoint.StandaloneCheckpointRecoveryFactory)4 ResourceProfile (org.apache.flink.runtime.clusterframework.types.ResourceProfile)4 TaskDeploymentDescriptor (org.apache.flink.runtime.deployment.TaskDeploymentDescriptor)4 JobGraph (org.apache.flink.runtime.jobgraph.JobGraph)4 TestingLeaderRetrievalService (org.apache.flink.runtime.leaderelection.TestingLeaderRetrievalService)4