Closed kaisun2000 closed 3 years ago
/**
* This test does NOT allow multiple jobs being assigned to an instance.
* @throws InterruptedException
*/
@Test
public void testMultipleJobAssignment() throws InterruptedException {
_runCounts.clear();
failTask = false;
String workflowName = TestHelper.getTestMethodName();
Workflow.Builder workflowBuilder = new Workflow.Builder(workflowName);
for (int i = 0; i < 20; i++) {
List<TaskConfig> taskConfigs = Lists.newArrayListWithCapacity(1);
taskConfigs.add(new TaskConfig("TaskOne", new HashMap<>()));
JobConfig.Builder jobBuilder = new JobConfig.Builder().setCommand("DummyCommand")
.addTaskConfigs(taskConfigs).setJobCommandConfigMap(_jobCommandMap);
workflowBuilder.addJob("JOB" + i, jobBuilder);
}
_driver.start(workflowBuilder.build());
_driver.pollForWorkflowState(workflowName, TaskState.COMPLETED);
Assert.assertEquals(_runCounts.size(), 5);
}
20 job over 5 instances, but is it possible that not all instance get job assigned?
Put a delay in task run; add dependency
Close test unstable tickets since we have an automatic tracking mechanism https://github.com/apache/helix/pull/1757 now for tracking the most recent test issues.
LOG 1555