Source:
<code>public void testPrioritizedJobsExecutionInvalidProrities() throws InterruptedException { CountDownAsyncJobListener countDownListener = configureListener(2); CommandContext ctxCMD = new CommandContext(); ctxCMD.setData("businessKey", "low priority"); ctxCMD.setData("priority", -1); ctxCMD.setData("delay", 10L); Date futureDate = new Date(System.currentTimeMillis() + EXTRA_TIME); <START> executorService.scheduleRequest("org.jbpm.executor.commands.DelayedPrintOutCommand", futureDate, ctxCMD); <END> CommandContext ctxCMD2 = new CommandContext(); ctxCMD2.setData("businessKey", "high priority"); ctxCMD2.setData("priority", 10); ctxCMD2.setData("delay", 100L); executorService.scheduleRequest("org.jbpm.executor.commands.DelayedPrintOutCommand", futureDate, ctxCMD2); countDownListener.waitTillCompleted(); List<RequestInfo> inErrorRequests = executorService.getInErrorRequests(new QueryContext()); assertEquals(0, inErrorRequests.size()); List<RequestInfo> queuedRequests = executorService.getQueuedRequests(new QueryContext()); assertEquals(0, queuedRequests.size()); List<RequestInfo> executedRequests = executorService.getCompletedRequests(new QueryContext()); assertEquals(2, executedRequests.size()); RequestInfo executedHigh = executedRequests.get(1); assertNotNull(executedHigh); assertEquals("high priority", executedHigh.getKey()); RequestInfo executedLow = executedRequests.get(0); assertNotNull(executedLow); assertEquals("low priority", executedLow.getKey()); assertTrue(executedLow.getTime().getTime() > executedHigh.getTime().getTime()); }</code><technical_language>This prolong execution of command including Thread.sleep() in it. I discussed change line 664 need >= there, we</technical_language>

Target:
public void testPrioritizedJobsExecutionInvalidProrities() throws InterruptedException { CountDownAsyncJobListener countDownListener = configureListener(2); CommandContext ctxCMD = new CommandContext(); ctxCMD.setData("businessKey", "low priority"); ctxCMD.setData("priority", -1); Date futureDate = new Date(System.currentTimeMillis() + EXTRA_TIME); executorService.scheduleRequest("org.jbpm.executor.commands.PrintOutCommand", futureDate, ctxCMD); CommandContext ctxCMD2 = new CommandContext(); ctxCMD2.setData("businessKey", "high priority"); ctxCMD2.setData("priority", 10); executorService.scheduleRequest("org.jbpm.executor.commands.PrintOutCommand", futureDate, ctxCMD2); countDownListener.waitTillCompleted(); List<RequestInfo> inErrorRequests = executorService.getInErrorRequests(new QueryContext()); assertEquals(0, inErrorRequests.size()); List<RequestInfo> queuedRequests = executorService.getQueuedRequests(new QueryContext()); assertEquals(0, queuedRequests.size()); List<RequestInfo> executedRequests = executorService.getCompletedRequests(new QueryContext()); assertEquals(2, executedRequests.size()); RequestInfo executedHigh = executedRequests.get(1); assertNotNull(executedHigh); assertEquals("high priority", executedHigh.getKey()); RequestInfo executedLow = executedRequests.get(0); assertNotNull(executedLow); assertEquals("low priority", executedLow.getKey()); assertTrue(executedLow.getTime().getTime() >= executedHigh.getTime().getTime()); }