use of org.apache.flink.runtime.operators.coordination.TestOperatorEvent in project flink by apache.
the class TaskExecutorOperatorEventHandlingTest method eventHandlingInTaskFailureFailsTask.
@Test
public void eventHandlingInTaskFailureFailsTask() throws Exception {
final JobID jobId = new JobID();
final ExecutionAttemptID eid = new ExecutionAttemptID();
try (TaskSubmissionTestEnvironment env = createExecutorWithRunningTask(jobId, eid, OperatorEventFailingInvokable.class)) {
final TaskExecutorGateway tmGateway = env.getTaskExecutorGateway();
final CompletableFuture<?> resultFuture = tmGateway.sendOperatorEventToTask(eid, new OperatorID(), new SerializedValue<>(new TestOperatorEvent()));
assertThat(resultFuture, futureWillCompleteExceptionally(FlinkException.class, Duration.ofSeconds(10)));
assertEquals(ExecutionState.FAILED, env.getTaskSlotTable().getTask(eid).getExecutionState());
}
}
use of org.apache.flink.runtime.operators.coordination.TestOperatorEvent in project flink by apache.
the class AdaptiveSchedulerTest method testDeliverOperatorEventToCoordinatorFailsInIllegalState.
@Test(expected = TaskNotRunningException.class)
public void testDeliverOperatorEventToCoordinatorFailsInIllegalState() throws Exception {
final AdaptiveScheduler scheduler = new AdaptiveSchedulerBuilder(createJobGraph(), mainThreadExecutor).build();
scheduler.deliverOperatorEventToCoordinator(new ExecutionAttemptID(), new OperatorID(), new TestOperatorEvent());
}
Aggregations