Dynamic failedJobRetryTimeCycle in Test


I have configured a failedJobRetryTimeCycle within a process definition.
I would like to change it dynamically prior to start it in a JUNIT test method, so within a transaction, I can reduce the number of retries and time period to wait for before doing an assertion on the expected outcome.

I have tried to put an EL expression for that, and found that it is not possible (getting the error described in this old OPEN issue: https://activiti.atlassian.net/browse/ACT-2108)

Could you provide me with a solution to dynamically change the failedJobRetryTimeCycle value or provide me with any other solution, so I can write a test without waiting for the failedJobRetryTimeCycle configured by default in the process definition?


Hi Remi,

Would setting a virtual time and running jobExecutor work for you?

// Move clock forward 1 hour from now
calendar = Calendar.getInstance();
calendar.add(Calendar.HOUR, 1);
calendar.add(Calendar.MINUTE, 5);
JobTestHelper.executeJobExecutorForTime(processEngineConfiguration, 1000, 100);


Thanks @martin.grofcik, I could finally handle that with a similar solution, using org.flowable.engine.impl.test.JobTestHelper#waitForJobExecutorOnCondition (where I can specify the maxMillisToWait) combined with a manual job execution via a utility method used in my test.