Integration test for process with timer

Hi, I would like to ask you, if there is any solution for this situation. We are using Flowable (6.4.2) together with Spring (5.0.2). In a particular project is a process that consists of service tasks and timers. It is necessary to write an integration test for this process, but there is a little trouble :slight_smile: Process instance runs in a different thread than timer so it is not possible to go through whole process in single thread, and integration test ends when timer is reached. Bean SpringProcessEngineConfiguration is configured with asyncExecutorActivate set to true and for test purposes we use SyncTaskExecutor.

Thank you for any ideas. Michal

Hi Michal

I solve this problem by setting the property “asyncExecutorActivate” to false in my tests, so that I have to activate/execute the async tasks manually. That makes it much easier to control your tests.

flowable.async-executor-activate=false

See example: flowable-engine/modules/flowable-engine/src/test/java/org/flowable/engine/test/bpmn/event/timer/TimerEventSubprocessTest.java at d05e91fee90098973a117a45c438c2ee60baaa9e · flowable/flowable-engine · GitHub

Regards,
Simon