From dc3eabec6e814451639c2a65e0cd30799ac3222c Mon Sep 17 00:00:00 2001 From: Filip Hrisafov Date: Fri, 2 Aug 2024 11:48:51 +0200 Subject: [PATCH] Increase the interval time for checking if there are jobs in the InstantTimeTimerEventTest The InstantTimeTimerEventTest is a test which test timer jobs. This means that we can have a scenario when the wait returns, but there are still jobs. The scenario (due to race conditions is the following). We start with a timer job and start the async executor * Test Thread: Check async job list is empty * Async Thread: Move timer job to async job * Test Thread: Check timer job list is empty Due to race conditions the test thread thinks that there are no more jobs and stops waiting and continues to the next check. --- .../test/bpmn/event/timer/InstantTimeTimerEventTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/flowable-engine/src/test/java/org/flowable/engine/test/bpmn/event/timer/InstantTimeTimerEventTest.java b/modules/flowable-engine/src/test/java/org/flowable/engine/test/bpmn/event/timer/InstantTimeTimerEventTest.java index a80069d0527..bcb172b48af 100644 --- a/modules/flowable-engine/src/test/java/org/flowable/engine/test/bpmn/event/timer/InstantTimeTimerEventTest.java +++ b/modules/flowable-engine/src/test/java/org/flowable/engine/test/bpmn/event/timer/InstantTimeTimerEventTest.java @@ -64,7 +64,7 @@ public void testVariableExpressionBoundaryTimerEvent() { processEngineConfiguration.getClock().setCurrentTime(nowCal.getTime()); try { - waitForJobExecutorToProcessAllJobsAndExecutableTimerJobs(10000L, 25L); + waitForJobExecutorToProcessAllJobsAndExecutableTimerJobs(10000L, 200L); assertThat(jobQuery.count()).isZero(); assertProcessEnded(pi.getId()); @@ -87,7 +87,7 @@ public void testBeanExpressionBoundaryTimerEvent() { processEngineConfiguration.getClock().setCurrentTime(nowCal.getTime()); try { - waitForJobExecutorToProcessAllJobsAndExecutableTimerJobs(10000L, 25L); + waitForJobExecutorToProcessAllJobsAndExecutableTimerJobs(10000L, 200L); assertThat(jobQuery.count()).isZero(); assertProcessEnded(pi.getId());