From 6c1d401215369f65e780f86a4a900b219d92dd66 Mon Sep 17 00:00:00 2001 From: houseme Date: Sat, 5 Sep 2026 19:55:03 +0800 Subject: [PATCH] test(scanner): reproduce same-cycle dirty aggregate replay Cover a Normal-to-Normal retry with a new dirty bucket generation after bucket persistence and root delivery failure. Co-Authored-By: heihutu Co-Authored-By: zhi22915 --- crates/scanner/src/scanner_io/tests.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/scanner/src/scanner_io/tests.rs b/crates/scanner/src/scanner_io/tests.rs index 0391c4928..e5a868875 100644 --- a/crates/scanner/src/scanner_io/tests.rs +++ b/crates/scanner/src/scanner_io/tests.rs @@ -418,7 +418,11 @@ async fn scoped_scan_production_entry_preserves_deep_and_full_maintenance_work() #[tokio::test] #[serial] async fn scoped_scan_same_cycle_maintenance_rewalks_after_root_delivery_failure() { - for (scan_mode, requires_full_scan) in [(HealScanMode::Deep, false), (HealScanMode::Normal, true)] { + for (scan_mode, requires_full_scan) in [ + (HealScanMode::Normal, false), + (HealScanMode::Deep, false), + (HealScanMode::Normal, true), + ] { let (_temp_dir, store) = setup_two_pool_scanner_store().await; clear_dirty_usage_buckets_for_tests(); for bucket in ["hot-bucket", "cold-bucket"] { @@ -480,6 +484,9 @@ async fn scoped_scan_same_cycle_maintenance_rewalks_after_root_delivery_failure( .await .expect("new cold object should persist"); record_dirty_usage_bucket("hot-bucket"); + if scan_mode == HealScanMode::Normal && !requires_full_scan { + record_dirty_usage_bucket("cold-bucket"); + } let ctx = CancellationToken::new(); let budget = ScannerCycleBudget::new(&ctx, ScannerCycleBudgetConfig::default()); let (updates, mut receiver) = mpsc::channel(1);