Skip to content

Commit 0455861

Browse files
authored
test: drain every due trigger after scheduler fault recovery (#1327)
The fault test checked recovery with one scheduler cycle, which evaluates at most 100 due triggers. With 400 triggers, a slow runner that crossed a minute boundary during recovery left the rest without their latest tick. Run enough cycles to drain every trigger due at the settled time.
1 parent a788b94 commit 0455861

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

  • crates/sqlbuild-orchestration/tests/scheduler/ticks

‎crates/sqlbuild-orchestration/tests/scheduler/ticks/helpers.rs‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -619,9 +619,12 @@ pub(crate) async fn fault_run(
619619
.0;
620620
}
621621
let settled = Utc::now();
622-
scheduler_cycle(&second, survivor)
623-
.await
624-
.expect("final recovery");
622+
for _ in 0..FAULT_TRIGGERS.div_ceil(100) {
623+
survivor = scheduler_cycle(&second, survivor)
624+
.await
625+
.expect("final recovery")
626+
.0;
627+
}
625628
let first = started
626629
.duration_trunc(TimeDelta::minutes(1))
627630
.expect("minute")

0 commit comments

Comments
 (0)