test(ilm): cover cancelled continuation resume (#5294)

Co-authored-by: heihutu <heihutu@gmail.com>
This commit is contained in:
houseme
2026-07-26 21:40:36 +08:00
committed by GitHub
parent 009dd93788
commit 0a25d25e68
@@ -7996,7 +7996,7 @@ mod tests {
..Default::default()
};
let report = enqueue_transition_for_existing_objects_scoped(ecstore, &bucket, options)
let report = enqueue_transition_for_existing_objects_scoped(ecstore.clone(), &bucket, options)
.await
.expect("manual transition dry-run scan should stop on active cancel");
@@ -8020,6 +8020,29 @@ mod tests {
assert_eq!(marker.as_deref(), Some(keys[0].as_str()));
assert_eq!(version_marker.as_deref(), Some("null"));
assert_eq!(cancel_polls.load(Ordering::SeqCst), 2);
let resumed = enqueue_transition_for_existing_objects_scoped(
ecstore,
&bucket,
ManualTransitionRunOptions {
prefix: prefix.to_string(),
continuation_token: Some(token.to_string()),
tier: Some("WARM".to_string()),
dry_run: true,
max_objects: Some(10),
..Default::default()
},
)
.await
.expect("manual transition dry-run scan should resume after active cancel");
assert!(!resumed.cancelled);
assert!(!resumed.was_truncated());
assert_eq!(resumed.scanned, 1);
assert_eq!(resumed.eligible, 1);
assert_eq!(resumed.dry_run_eligible, 1);
assert_eq!(resumed.enqueued, 0);
assert!(resumed.continuation_token.is_none());
}
#[tokio::test]