use of org.apache.flink.runtime.jobmaster.JobResult in project flink by apache.
the class LeaderChangeClusterComponentsTest method testReelectionOfDispatcher.
@Test
public void testReelectionOfDispatcher() throws Exception {
final CompletableFuture<JobSubmissionResult> submissionFuture = miniCluster.submitJob(jobGraph);
submissionFuture.get();
CompletableFuture<JobResult> jobResultFuture = miniCluster.requestJobResult(jobId);
highAvailabilityServices.revokeDispatcherLeadership().get();
JobResult jobResult = jobResultFuture.get();
assertEquals(jobResult.getApplicationStatus(), ApplicationStatus.UNKNOWN);
highAvailabilityServices.grantDispatcherLeadership();
BlockingOperator.isBlocking = false;
final CompletableFuture<JobSubmissionResult> submissionFuture2 = miniCluster.submitJob(jobGraph);
submissionFuture2.get();
final CompletableFuture<JobResult> jobResultFuture2 = miniCluster.requestJobResult(jobId);
jobResult = jobResultFuture2.get();
JobResultUtils.assertSuccess(jobResult);
}
use of org.apache.flink.runtime.jobmaster.JobResult in project flink by apache.
the class CheckpointResourcesCleanupRunnerTest method testRequestJobWithFailure.
@Test
public void testRequestJobWithFailure() {
final SerializedThrowable expectedError = new SerializedThrowable(new Exception("Expected exception"));
final JobResult jobResult = createJobResultWithFailure(expectedError);
testRequestJobExecutionGraph(jobResult, System.currentTimeMillis(), actualExecutionGraph -> Objects.requireNonNull(actualExecutionGraph.getFailureInfo()).getException().equals(expectedError));
}
use of org.apache.flink.runtime.jobmaster.JobResult in project flink by apache.
the class CheckpointResourcesCleanupRunnerTest method testRequestJob_JobId.
@Test
public void testRequestJob_JobId() {
final JobResult jobResult = createDummySuccessJobResult();
testRequestJobExecutionGraph(jobResult, System.currentTimeMillis(), actualExecutionGraph -> actualExecutionGraph.getJobID().equals(jobResult.getJobId()));
}
use of org.apache.flink.runtime.jobmaster.JobResult in project flink by apache.
the class SessionDispatcherLeaderProcessTest method testRecoveryWithMultipleJobGraphsAndOneMatchingDirtyJobResult.
@Test
public void testRecoveryWithMultipleJobGraphsAndOneMatchingDirtyJobResult() throws Exception {
final JobResult matchingDirtyJobResult = TestingJobResultStore.createSuccessfulJobResult(JOB_GRAPH.getJobID());
final JobGraph otherJobGraph = JobGraphTestUtils.emptyJobGraph();
testJobRecovery(Arrays.asList(otherJobGraph, JOB_GRAPH), Collections.singleton(matchingDirtyJobResult), actualRecoveredJobGraphs -> assertThat(actualRecoveredJobGraphs).singleElement().isEqualTo(otherJobGraph), actualRecoveredDirtyJobResults -> assertThat(actualRecoveredDirtyJobResults).singleElement().isEqualTo(matchingDirtyJobResult));
}
use of org.apache.flink.runtime.jobmaster.JobResult in project flink by apache.
the class SessionDispatcherLeaderProcessTest method testRecoveryWithJobGraphAndMatchingDirtyJobResult.
@Test
public void testRecoveryWithJobGraphAndMatchingDirtyJobResult() throws Exception {
final JobResult matchingDirtyJobResult = TestingJobResultStore.createSuccessfulJobResult(JOB_GRAPH.getJobID());
testJobRecovery(Collections.singleton(JOB_GRAPH), Collections.singleton(matchingDirtyJobResult), actualRecoveredJobGraphs -> assertThat(actualRecoveredJobGraphs).isEmpty(), actualRecoveredDirtyJobResults -> assertThat(actualRecoveredDirtyJobResults).singleElement().isEqualTo(matchingDirtyJobResult));
}
Aggregations