From 513e5f10182d1fa4fd93ad02fc7b3d3623c9b11b Mon Sep 17 00:00:00 2001 From: houseme Date: Thu, 16 Jul 2026 13:50:52 +0800 Subject: [PATCH] test(ilm): scope restore e2e object under the rule's test/ prefix (#4868) `restore_object_usecase_reports_ongoing_conflict_and_completion` failed deterministically in the "ILM Integration (serial)" lane, panicking at its setup step ("object should transition before the restore API runs"): the object never reached transition status `complete` within the 15s wait, before the restore logic under test even ran. Root cause: the test object key was `restore/api-object.bin`, but `set_bucket_lifecycle_transition_with_tier` scopes the transition rule to `test/`. An object outside that prefix never matches the rule, so `enqueue_transition_for_existing_objects` never enqueues it (confirmed: the mock tier saw zero puts and the object's transitioned status stayed empty) and `wait_for_transition` times out. Every other transition test in this file already keys its objects under `test/`. The break shipped in #4860 because that PR's ILM serial lane was skipped on the merge run, so the test never actually executed in CI. Fix: key the object as `test/restore/api-object.bin` so it matches the rule. The restore API, tier copy-back, and local-GET assertions are unchanged (they address the object by bucket+key; the remote tier name is generated internally). Co-authored-by: heihutu --- rustfs/src/app/lifecycle_transition_api_test.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rustfs/src/app/lifecycle_transition_api_test.rs b/rustfs/src/app/lifecycle_transition_api_test.rs index 651d509d6..7c6e9b7e8 100644 --- a/rustfs/src/app/lifecycle_transition_api_test.rs +++ b/rustfs/src/app/lifecycle_transition_api_test.rs @@ -1541,7 +1541,11 @@ async fn restore_object_usecase_reports_ongoing_conflict_and_completion() { let backend = register_mock_tier(&tier_name).await; let bucket = format!("test-api-restore-{}", &Uuid::new_v4().simple().to_string()[..8]); - let object = "restore/api-object.bin"; + // Must live under the `test/` prefix: `set_bucket_lifecycle_transition_with_tier` + // scopes the transition rule to `test/`, so an object + // outside it never matches, is never enqueued, and never transitions — the + // setup `wait_for_transition` would then time out before the restore assertions. + let object = "test/restore/api-object.bin"; let payload: Vec = (0..128 * 1024).map(|i| (i % 251) as u8).collect(); create_test_bucket(&ecstore, bucket.as_str()).await;