use of io.crate.execution.jobs.TasksService in project crate by crate.
the class NodeDisconnectJobMonitorServiceTest method testOnNodeDisconnectedKillsJobOriginatingFromThatNode.
@Test
public void testOnNodeDisconnectedKillsJobOriginatingFromThatNode() throws Exception {
TasksService tasksService = tasksInstance();
RootTask.Builder builder = tasksService.newBuilder(UUID.randomUUID());
builder.addTask(new DummyTask());
RootTask context = tasksService.createTask(builder);
NodeDisconnectJobMonitorService monitorService = new NodeDisconnectJobMonitorService(tasksService, new NodeLimits(new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS)), mock(TransportService.class), mock(TransportKillJobsNodeAction.class));
monitorService.onNodeDisconnected(new DiscoveryNode(NODE_ID, buildNewFakeTransportAddress(), Version.CURRENT), mock(Transport.Connection.class));
expectedException.expect(TaskMissing.class);
tasksService.getTask(context.jobId());
monitorService.close();
}
Aggregations