mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-27 23:47:28 +00:00
test(ilm): cover admission scope parallelism (#5293)
* test(ilm): cover cross-bucket admission scope Co-Authored-By: heihutu <heihutu@gmail.com> * fix(ilm): remove duplicate transition progress import Co-Authored-By: heihutu <heihutu@gmail.com> --------- Co-authored-by: heihutu <heihutu@gmail.com>
This commit is contained in:
@@ -4627,10 +4627,10 @@ mod tests {
|
|||||||
load_manual_transition_job_record, load_manual_transition_scope_admission,
|
load_manual_transition_job_record, load_manual_transition_scope_admission,
|
||||||
load_manual_transition_scope_admission_with_etag, manual_transition_scope_record_object_name,
|
load_manual_transition_scope_admission_with_etag, manual_transition_scope_record_object_name,
|
||||||
manual_transition_worker_result_object_name, manual_transition_worker_result_task_key,
|
manual_transition_worker_result_object_name, manual_transition_worker_result_task_key,
|
||||||
persist_manual_transition_job_progress, reconcile_manual_transition_worker_results,
|
reconcile_manual_transition_worker_results, record_manual_transition_worker_result, renew_manual_transition_job_lease,
|
||||||
record_manual_transition_worker_result, renew_manual_transition_job_lease, request_manual_transition_job_cancel,
|
request_manual_transition_job_cancel, save_manual_transition_job_record,
|
||||||
save_manual_transition_job_record, save_manual_transition_scope_admission_if_absent,
|
save_manual_transition_scope_admission_if_absent, save_manual_transition_scope_admission_if_current,
|
||||||
save_manual_transition_scope_admission_if_current, save_manual_transition_worker_result_if_absent,
|
save_manual_transition_worker_result_if_absent,
|
||||||
};
|
};
|
||||||
use crate::bucket::lifecycle::replication_sink::{
|
use crate::bucket::lifecycle::replication_sink::{
|
||||||
ReplicateDecision, ReplicateTargetDecision, ReplicationStatusType, VersionPurgeStatusType,
|
ReplicateDecision, ReplicateTargetDecision, ReplicationStatusType, VersionPurgeStatusType,
|
||||||
@@ -8622,11 +8622,30 @@ mod tests {
|
|||||||
assert_eq!(active.scope_key, legacy.scope_key);
|
assert_eq!(active.scope_key, legacy.scope_key);
|
||||||
assert!(
|
assert!(
|
||||||
matches!(
|
matches!(
|
||||||
load_manual_transition_scope_admission(ecstore, &new_record.scope_key).await,
|
load_manual_transition_scope_admission(ecstore.clone(), &new_record.scope_key).await,
|
||||||
Err(Error::ConfigNotFound)
|
Err(Error::ConfigNotFound)
|
||||||
),
|
),
|
||||||
"conflicted bucket-level admission must be released"
|
"conflicted bucket-level admission must be released"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
let other_bucket_record =
|
||||||
|
ManualTransitionJobRecord::new(Uuid::new_v4(), "manual-legacy-scope-other-bucket", &legacy_options, "new-owner");
|
||||||
|
save_manual_transition_job_record(ecstore.clone(), &other_bucket_record)
|
||||||
|
.await
|
||||||
|
.expect("other bucket job record should save");
|
||||||
|
|
||||||
|
let other_bucket_claim = claim_manual_transition_scope_admission(
|
||||||
|
ecstore.clone(),
|
||||||
|
&ManualTransitionScopeAdmission::from_job(&other_bucket_record),
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
.expect("cross-bucket admission claim should resolve");
|
||||||
|
|
||||||
|
assert_eq!(other_bucket_claim, ManualTransitionScopeAdmissionClaim::Claimed);
|
||||||
|
let current = load_manual_transition_scope_admission(ecstore, &other_bucket_record.scope_key)
|
||||||
|
.await
|
||||||
|
.expect("other bucket admission should be saved");
|
||||||
|
assert_eq!(current.job_id, other_bucket_record.job_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
|
|||||||
@@ -1741,10 +1741,19 @@ mod tests {
|
|||||||
..Default::default()
|
..Default::default()
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
let other_bucket = manual_transition_scope_key(
|
||||||
|
"bucket-b",
|
||||||
|
&ManualTransitionRunOptions {
|
||||||
|
prefix: "logs/".to_string(),
|
||||||
|
tier: Some("warm".to_string()),
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
assert_eq!(broad, nested);
|
assert_eq!(broad, nested);
|
||||||
assert_eq!(broad, disjoint);
|
assert_eq!(broad, disjoint);
|
||||||
assert_ne!(broad, dry_run);
|
assert_ne!(broad, dry_run);
|
||||||
|
assert_ne!(broad, other_bucket);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
Reference in New Issue
Block a user