Skip to content

Commit

Permalink
Fix flaky tests for scheduled tasks actuator support
Browse files Browse the repository at this point in the history
  • Loading branch information
bclozel committed Jul 25, 2024
1 parent e8391f1 commit 397f879
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ void fixedDelayScheduledMethodIsReported() {
assertThat(tasks.getCustom()).isEmpty();
assertThat(tasks.getFixedDelay()).hasSize(1);
FixedDelayTaskDescriptor description = (FixedDelayTaskDescriptor) tasks.getFixedDelay().get(0);
assertThat(description.getInitialDelay()).isEqualTo(2);
assertThat(description.getInterval()).isOne();
assertThat(description.getInitialDelay()).isEqualTo(2000);
assertThat(description.getInterval()).isEqualTo(1000);
assertThat(description.getRunnable().getTarget())
.isEqualTo(FixedDelayScheduledMethod.class.getName() + ".fixedDelay");
assertThat(description.getLastExecution()).isNull();
Expand Down Expand Up @@ -145,8 +145,8 @@ void fixedRateScheduledMethodIsReported() {
assertThat(tasks.getCustom()).isEmpty();
assertThat(tasks.getFixedRate()).hasSize(1);
FixedRateTaskDescriptor description = (FixedRateTaskDescriptor) tasks.getFixedRate().get(0);
assertThat(description.getInitialDelay()).isEqualTo(4);
assertThat(description.getInterval()).isEqualTo(3);
assertThat(description.getInitialDelay()).isEqualTo(4000);
assertThat(description.getInterval()).isEqualTo(3000);
assertThat(description.getRunnable().getTarget())
.isEqualTo(FixedRateScheduledMethod.class.getName() + ".fixedRate");
assertThat(description.getLastExecution()).isNull();
Expand Down Expand Up @@ -239,7 +239,7 @@ ScheduledTasksEndpoint endpoint(Collection<ScheduledTaskHolder> scheduledTaskHol

static class FixedDelayScheduledMethod {

@Scheduled(fixedDelay = 1, initialDelay = 2)
@Scheduled(fixedDelay = 1000, initialDelay = 2000)
void fixedDelay() {

}
Expand All @@ -248,7 +248,7 @@ void fixedDelay() {

static class FixedRateScheduledMethod {

@Scheduled(fixedRate = 3, initialDelay = 4)
@Scheduled(fixedRate = 3000, initialDelay = 4000)
void fixedRate() {

}
Expand Down

0 comments on commit 397f879

Please sign in to comment.