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/08/15 23:38:55 UTC

[GitHub] [helix] kaisun2000 commented on issue #1278: Fix TestEnqueueJobs.testQueueJobsMaxCapacity

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


   ```
       for (int i = 0; i < numberOfJobsAddedInitially; i++) {
         _driver.pollForJobState(queueName, TaskUtil.getNamespacedJobName(queueName, "JOB" + i),
             TaskState.COMPLETED);
       }
   ```
   pollForJobState is following, timeout is 5 minutes. Enable to 15 minutes with test case time to 10 minute to have a try. Also, add more about if ctx is null or the other case.
   
   ```
      long st = System.currentTimeMillis();
       do {
         Thread.sleep(timeToSleep);
         ctx = getWorkflowContext(workflowName);
       } while ((ctx == null || ctx.getJobState(jobName) == null
           || !allowedStates.contains(ctx.getJobState(jobName)))
           && System.currentTimeMillis() < st + timeout);
   
       if (ctx == null || !allowedStates.contains(ctx.getJobState(jobName))) {
         throw new HelixException(
             String.format("Workflow \"%s\" context is null or job \"%s\" is not in states: %s",
                 workflowName, jobName, allowedStates));
       }
   ```


----------------------------------------------------------------
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