Dynamic failedJobRetryTimeCycle in Test

Hi,

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?

Thanks

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);
processEngineConfiguration.getClock().setCurrentTime(calendar.getTime());
JobTestHelper.executeJobExecutorForTime(processEngineConfiguration, 1000, 100);

Martin

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.