kaisun2000 commented on issue #1283:
URL: https://github.com/apache/helix/issues/1283#issuecomment-699236281
two points.
1/ add some delay for the job
2/ batch queue the two jobs.
the code is like this now:
```
// Create jobs that can be assigned to any instances
List<JobConfig.Builder> jobConfigBuilders = new
ArrayList<JobConfig.Builder>();
for (int i = 0; i < PARALLEL_COUNT; i++) {
List<TaskConfig> taskConfigs = new ArrayList<TaskConfig>();
for (int j = 0; j < TASK_COUNT; j++) {
taskConfigs.add(new TaskConfig.Builder()
.setTaskId("job_" + (i + 1) + "_task_" + j)
.setCommand(MockTask.TASK_COMMAND)
.addConfig(MockTask.JOB_DELAY, "2000")
.build());
}
jobConfigBuilders.add(new
JobConfig.Builder().addTaskConfigs(taskConfigs));
}
_driver.stop(queueName);
List<String> jobNames = new ArrayList<>();
for (int i = 0; i < jobConfigBuilders.size(); ++i) {
jobNames.add("job_" + (i + 1));
//_driver.enqueueJob(queueName, "job_" + (i + 1),
jobConfigBuilders.get(i));
}
_driver.enqueueJobs(queueName, jobNames, jobConfigBuilders);
_driver.resume(queueName);
Thread.sleep(2000);
Assert.assertTrue(TaskTestUtil.pollForWorkflowParallelState(_driver,
queueName));
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]