mirror of
https://github.com/rustfs/rustfs.git
synced 2026-07-26 08:18:18 +00:00
test(ilm): cover manual transition queue pressure status (#5265)
Co-authored-by: heihutu <heihutu@gmail.com>
This commit is contained in:
@@ -1163,6 +1163,31 @@ mod tests {
|
||||
assert!(record.error.is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn manual_transition_job_record_queue_pressure_report_is_partial() {
|
||||
let options = ManualTransitionRunOptions::default();
|
||||
let mut record = ManualTransitionJobRecord::new(Uuid::new_v4(), "bucket", &options, TEST_OWNER);
|
||||
let queue_snapshot = ManualTransitionQueueSnapshot {
|
||||
queue_capacity: 1,
|
||||
queue_full: 1,
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
record.complete(
|
||||
ManualTransitionRunReport {
|
||||
skipped_queue_full: 1,
|
||||
..Default::default()
|
||||
},
|
||||
queue_snapshot,
|
||||
);
|
||||
|
||||
assert_eq!(record.state, ManualTransitionJobState::Partial);
|
||||
assert_eq!(record.report.skipped_queue_full, 1);
|
||||
assert_eq!(record.queue_snapshot.queue_capacity, 1);
|
||||
assert_eq!(record.queue_snapshot.queue_full, 1);
|
||||
assert!(record.error.is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn manual_transition_scope_key_is_stable_and_sanitized() {
|
||||
let first = manual_transition_scope_key(
|
||||
|
||||
Reference in New Issue
Block a user