fix(lifecycle): harden manual transition rollout checks (#5344)

Co-authored-by: heihutu <heihutu@gmail.com>
This commit is contained in:
houseme
2026-07-28 01:29:06 +08:00
committed by GitHub
parent 0e42a3d1d9
commit 6d3ce90c0f
7 changed files with 271 additions and 51 deletions
@@ -3452,7 +3452,10 @@ impl ManualTransitionRunReport {
}
pub fn has_partial_enqueue(&self) -> bool {
self.skipped_queue_full > 0 || self.skipped_queue_closed > 0 || self.skipped_queue_timeout > 0
self.skipped_already_in_flight > 0
|| self.skipped_queue_full > 0
|| self.skipped_queue_closed > 0
|| self.skipped_queue_timeout > 0
}
pub fn was_truncated(&self) -> bool {
@@ -2460,6 +2460,25 @@ mod tests {
assert!(record.error.is_none());
}
#[test]
fn manual_transition_job_record_in_flight_skip_report_is_partial() {
let options = ManualTransitionRunOptions::default();
let mut record = ManualTransitionJobRecord::new(Uuid::new_v4(), "bucket", &options, TEST_OWNER);
record.complete(
ManualTransitionRunReport {
eligible: 1,
skipped_already_in_flight: 1,
..Default::default()
},
ManualTransitionQueueSnapshot::default(),
);
assert_eq!(record.state, ManualTransitionJobState::Partial);
assert_eq!(record.report.skipped_already_in_flight, 1);
assert!(record.error.is_none());
}
#[test]
fn manual_transition_job_record_queue_pressure_reports_persist_readback() {
let options = ManualTransitionRunOptions {