[Improve](Job)Job internal interface provides immediate scheduling (#23735)
Delete meaningless job status System scheduling is executed in the time wheel Optimize window calculation code
This commit is contained in:
@ -132,6 +132,18 @@ public class TimerJobManagerTest {
|
||||
Assertions.assertEquals(2, testExecuteCount.get());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCycleSchedulerWithImmediatelyStart(@Mocked Env env) throws DdlException {
|
||||
setContext(env);
|
||||
long startTimestamp = System.currentTimeMillis();
|
||||
job.setImmediatelyStart(true);
|
||||
timerJobManager.registerJob(job);
|
||||
//consider the time of the first execution and give some buffer time
|
||||
Awaitility.await().atMost(16, TimeUnit.SECONDS).until(() -> System.currentTimeMillis()
|
||||
>= startTimestamp + 15000L);
|
||||
Assertions.assertEquals(3, testExecuteCount.get());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOneTimeJob(@Mocked Env env) throws DdlException {
|
||||
setContext(env);
|
||||
|
||||
Reference in New Issue
Block a user