diff --git a/.vscode/launch.json b/.vscode/launch.json index 62da1e91..4f028d27 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -121,6 +121,25 @@ "rust" ], }, + { + "type": "lldb", + "request": "launch", + "name": "Debug test_lifecycle_transition_basic", + "cargo": { + "args": [ + "test", + "-p", + "rustfs-scanner", + "--test", + "lifecycle_integration_test", + "serial_tests::test_lifecycle_transition_basic", + "-j", + "1" + ] + }, + "args": [], + "cwd": "${workspaceFolder}" + }, { "name": "Debug executable target/debug/test", "type": "lldb", diff --git a/Cargo.lock b/Cargo.lock index b95ae68a..a0183c1d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7619,6 +7619,7 @@ dependencies = [ "path-clean", "rand 0.10.0-rc.5", "rmp-serde", + "rustfs-ahm", "rustfs-common", "rustfs-config", "rustfs-ecstore", diff --git a/crates/scanner/Cargo.toml b/crates/scanner/Cargo.toml index f4de56de..3e4e55b6 100644 --- a/crates/scanner/Cargo.toml +++ b/crates/scanner/Cargo.toml @@ -50,6 +50,7 @@ rustfs-filemeta = { workspace = true } rustfs-madmin = { workspace = true } tokio-util = { workspace = true } rustfs-ecstore = { workspace = true } +rustfs-ahm = { workspace = true } http = { workspace = true } rand = { workspace = true } s3s = { workspace = true } diff --git a/crates/scanner/tests/lifecycle_integration_test.rs b/crates/scanner/tests/lifecycle_integration_test.rs index b0a4d79e..165fd6d4 100644 --- a/crates/scanner/tests/lifecycle_integration_test.rs +++ b/crates/scanner/tests/lifecycle_integration_test.rs @@ -22,6 +22,7 @@ use rustfs_ecstore::{ store_api::{MakeBucketOptions, ObjectIO, ObjectOptions, PutObjReader, StorageAPI}, tier::tier_config::{TierConfig, TierMinIO, TierType}, }; +use rustfs_ahm::{heal::storage::ECStoreHealStorage, init_heal_manager}; use rustfs_scanner::scanner::init_data_scanner; use serial_test::serial; use std::{ @@ -52,7 +53,7 @@ async fn setup_test_env() -> (Vec, Arc) { } // create temp dir as 4 disks with unique base dir - let test_base_dir = format!("/tmp/rustfs_ahm_lifecycle_test_{}", uuid::Uuid::new_v4()); + let test_base_dir = format!("/tmp/rustfs_scanner_lifecycle_test_{}", uuid::Uuid::new_v4()); let temp_dir = std::path::PathBuf::from(&test_base_dir); if temp_dir.exists() { fs::remove_dir_all(&temp_dir).await.ok(); @@ -397,6 +398,8 @@ mod serial_tests { let ctx = CancellationToken::new(); // Start scanner + let heal_storage = Arc::new(ECStoreHealStorage::new(ecstore.clone())); + init_heal_manager(heal_storage, None).await; init_data_scanner(ctx.clone(), ecstore.clone()).await; println!("✅ Scanner started");