db-scheduler shutting down while some jobs haven't processed #387
-
I am using db-scheduler to queue up one-time tasks, that write to a db. It seems like my tests are racing with db-scheduler.
Is it possible to configure db-scheduler to keep the test runner alive until all jobs finish processing? I understand this might not even be a problem with db-scheduler, and I might need to look at configuring the test instead |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
In some of my tests I am using the It has a special |
Beta Was this translation helpful? Give feedback.
In some of my tests I am using the
ManualScheduler
(made for tests) which has the property you require. See DeleteUnresolvedTest.javaIt has a special
ExecutorService
that runs executions in the current thread. I think the methodscheduler.runAnyDueExecutions();
should run and wait for any scheduled executions, so that asserts can be made after that.