use of io.druid.indexing.overlord.TestRemoteTaskRunnerConfig in project druid by druid-io.
the class JavaScriptWorkerSelectStrategyTest method testNoWorkerCanRunTask.
@Test
public void testNoWorkerCanRunTask() {
ImmutableMap<String, ImmutableWorkerInfo> workerMap = ImmutableMap.of("10.0.0.1", createMockWorker(1, false, true), "10.0.0.4", createMockWorker(1, false, true));
Optional<ImmutableWorkerInfo> workerForBatchTask = STRATEGY.findWorkerForTask(new TestRemoteTaskRunnerConfig(new Period("PT1S")), workerMap, createMockTask("index_hadoop"));
Assert.assertFalse(workerForBatchTask.isPresent());
Optional<ImmutableWorkerInfo> workerForOtherTask = STRATEGY.findWorkerForTask(new TestRemoteTaskRunnerConfig(new Period("PT1S")), workerMap, createMockTask("otherTask"));
// all other tasks should be sent to worker2
Assert.assertFalse(workerForOtherTask.isPresent());
}
Aggregations