Skip to content

Commit

Permalink
Increase the interval time for checking if there are jobs in the Inst…
Browse files Browse the repository at this point in the history
…antTimeTimerEventTest

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.
  • Loading branch information
filiphr committed Aug 2, 2024
1 parent 96251b7 commit dc3eabe
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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());
Expand Down

0 comments on commit dc3eabe

Please sign in to comment.