use of org.apache.flink.runtime.scheduler.DefaultScheduler in project flink by apache.
the class OperatorCoordinatorSchedulerTest method createAndStartScheduler.
private DefaultScheduler createAndStartScheduler() throws Exception {
final DefaultScheduler scheduler = setupTestJobAndScheduler(new TestingOperatorCoordinator.Provider(testOperatorId));
scheduler.startScheduling();
executor.triggerAll();
// guard test assumptions: this brings tasks into DEPLOYING state
assertEquals(ExecutionState.DEPLOYING, SchedulerTestingUtils.getExecutionState(scheduler, testVertexId, 0));
return scheduler;
}
use of org.apache.flink.runtime.scheduler.DefaultScheduler in project flink by apache.
the class OperatorCoordinatorSchedulerTest method testSnapshotSyncFailureFailsCheckpoint.
@Test
public void testSnapshotSyncFailureFailsCheckpoint() throws Exception {
final OperatorCoordinator.Provider failingCoordinatorProvider = new TestingOperatorCoordinator.Provider(testOperatorId, CoordinatorThatFailsCheckpointing::new);
final DefaultScheduler scheduler = createSchedulerAndDeployTasks(failingCoordinatorProvider);
final CompletableFuture<?> checkpointFuture = triggerCheckpoint(scheduler);
assertThat(checkpointFuture, futureWillCompleteWithTestException());
}
use of org.apache.flink.runtime.scheduler.DefaultScheduler in project flink by apache.
the class OperatorCoordinatorSchedulerTest method taskRepeatedFailureNotifyCoordinator.
@Test
public void taskRepeatedFailureNotifyCoordinator() throws Exception {
final DefaultScheduler scheduler = createSchedulerAndDeployTasks();
final TestingOperatorCoordinator coordinator = getCoordinator(scheduler);
failAndRestartTask(scheduler, 0);
failAndRestartTask(scheduler, 0);
assertEquals(2, coordinator.getFailedTasks().size());
assertThat(coordinator.getFailedTasks(), contains(0, 0));
}
use of org.apache.flink.runtime.scheduler.DefaultScheduler in project flink by apache.
the class OperatorCoordinatorSchedulerTest method testGlobalFailoverDoesNotNotifyLocalRestore.
@Test
public void testGlobalFailoverDoesNotNotifyLocalRestore() throws Exception {
final DefaultScheduler scheduler = createSchedulerAndDeployTasks();
final TestingOperatorCoordinator coordinator = getCoordinator(scheduler);
takeCompleteCheckpoint(scheduler, coordinator, new byte[0]);
failGlobalAndRestart(scheduler, new TestException());
assertThat(coordinator.getRestoredTasks(), empty());
}
use of org.apache.flink.runtime.scheduler.DefaultScheduler in project flink by apache.
the class OperatorCoordinatorSchedulerTest method testBatchLocalFailoverDoesNotResetToCheckpoint.
@Test
public void testBatchLocalFailoverDoesNotResetToCheckpoint() throws Exception {
final DefaultScheduler scheduler = createSchedulerWithoutCheckpointingAndDeployTasks();
final TestingOperatorCoordinator coordinator = getCoordinator(scheduler);
failAndRestartTask(scheduler, 0);
assertNull("coordinator should not have a restored checkpoint", coordinator.getLastRestoredCheckpointState());
}
Aggregations