You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2020/09/25 18:13:29 UTC

[GitHub] [helix] kaisun2000 commented on issue #1407: fix flaky test TestTaskAssignmentCalculator.testMultipleJobAssignment

kaisun2000 commented on issue #1407:
URL: https://github.com/apache/helix/issues/1407#issuecomment-699077706


   ```
     /**
      * 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);
     }
   
   ```


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org