Skip to content

Commit

Permalink
fix(core): SchedulerScheduleOnDatesTest.recoverNoneMissing flakiness
Browse files Browse the repository at this point in the history
Fixes #4971
  • Loading branch information
loicmathieu committed Sep 19, 2024
1 parent 6d10fb3 commit ac77f9c
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import io.kestra.jdbc.runner.JdbcScheduler;
import io.kestra.plugin.core.trigger.ScheduleOnDates;
import jakarta.inject.Inject;
import org.junit.jupiter.api.RepeatedTest;
import org.junit.jupiter.api.Test;
import reactor.core.publisher.Flux;

Expand Down Expand Up @@ -251,7 +252,9 @@ void recoverNONEMissing() throws Exception {
Await.until(() -> scheduler.isReady(), Duration.ofMillis(100), Duration.ofSeconds(5));

Trigger newTrigger = this.triggerState.findLast(lastTrigger).orElseThrow();
assertThat(newTrigger.getNextExecutionDate().toLocalDateTime().truncatedTo(ChronoUnit.SECONDS), is(now.toLocalDateTime().truncatedTo(ChronoUnit.SECONDS)));
// depending on the exact timing of events, the next date can be now or after
assertThat(newTrigger.getNextExecutionDate().toLocalDateTime().truncatedTo(ChronoUnit.SECONDS),
oneOf(now.toLocalDateTime().truncatedTo(ChronoUnit.SECONDS), after.toLocalDateTime().truncatedTo(ChronoUnit.SECONDS)));
}
}
}

0 comments on commit ac77f9c

Please sign in to comment.