Skip to content

Commit

Permalink
Update TU so that it actually fails on v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
amanteaux committed Jan 11, 2019
1 parent d9b9584 commit 8355012
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/test/java/com/coreoz/wisp/SchedulerTest.java
Expand Up @@ -328,13 +328,14 @@ public void check_that_a_running_job_has_the_right_status() throws InterruptedEx
public void check_that_a_long_running_job_does_not_prevent_other_job_to_run() throws InterruptedException {
Scheduler scheduler = new Scheduler();

Job job = scheduler.schedule(Utils.doNothing(), Schedules.fixedDelaySchedule(Duration.ofMillis(10)));
Thread.sleep(25L);
scheduler.schedule(Utils.TASK_THAT_SLEEP_FOR_200MS, Schedules.fixedDelaySchedule(Duration.ofMillis(1)));
Thread.sleep(40L);
Job job = scheduler.schedule(Utils.doNothing(), Schedules.fixedDelaySchedule(Duration.ofMillis(1)));
Thread.sleep(40L);
long countBeforeSleep = job.executionsCount();
Thread.sleep(50L);
scheduler.gracefullyShutdown();

assertThat(job.executionsCount()).isGreaterThan(5);
assertThat(job.executionsCount() - countBeforeSleep).isGreaterThan(3);
}

private void runTwoConcurrentJobsForAtLeastFiftyIterations(Scheduler scheduler)
Expand Down

0 comments on commit 8355012

Please sign in to comment.