mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-18 18:46:17 +00:00
test(lifecycle,scanner): drop 47 no-op #[serial] markers (backlog#1846 T1) (#6213)
Second batch of the #[serial] sweep started in #6209. nextest is the repository's authoritative runner and executes every test in its own process, so serial_test's in-process mutex cannot serialize tests against each other -- docs/testing/README.md documents this, and the mechanism that actually serializes across the process boundary is a .config/nextest.toml [test-groups] entry with max-threads = 1. Unlike the first batch (e2e, process-isolated by construction), these are in-crate unit tests that could genuinely share process state under the `cargo test` fallback runner, where #[serial] IS still effective. Every marker was therefore reviewed individually and removed only where the test provably touches neither the process environment nor a process-global. Removed (47, pure deletions, no test bodies touched): crates/lifecycle/src/core.rs 35 crates/scanner/src/scanner.rs 12 The lifecycle removals are all validate_* / filter_rules_* / has_active_rules_* / noncurrent_versions_expiration_limit_* tests that build a local BucketLifecycleConfiguration and call a &self method walking only that value. The scanner removals are pure duration arithmetic (randomized_cycle_delay_for, initial_scanner_delay_for with an explicit Some(secs), the bitrot-disabled early return of scanner_clean_idle_max_interval) and background_heal_info_for_scan_complete / _for_scan_result field comparisons over locally built values. Retained deliberately -- see the PR body for the full list and reasons: crates/ecstore/src/bucket/lifecycle/bucket_lifecycle_ops.rs 101 (all) crates/lifecycle/src/core.rs 44 crates/scanner/src/scanner.rs 53 bucket_lifecycle_ops.rs keeps every marker: its test module caches a process-wide `static STALE_MULTIPART_TEST_ENV: OnceLock<(Vec<PathBuf>, Arc<ECStore>)>`, and its own reregister_env_local_disks helper documents in-tree that sibling #[serial] tests reset and reshape the shared local-disk registry for each other. That sharing is real, so the markers stay. No test was renamed, added, or deleted; no reserved migration-gate name substring is affected; no .config/nextest.toml entry references any of the 47 removed tests.
This commit is contained in:
@@ -4574,7 +4574,6 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[serial]
|
||||
fn test_randomized_cycle_delay_keeps_configured_start_delay() {
|
||||
// 120s with ±10% jitter should stay clearly above the historic 30s cap.
|
||||
let delay = randomized_cycle_delay_for(Duration::from_secs(120));
|
||||
@@ -4593,7 +4592,6 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[serial]
|
||||
fn test_initial_scanner_delay_uses_configured_start_delay() {
|
||||
let delay = initial_scanner_delay_for(Some(120));
|
||||
assert!(delay >= Duration::from_secs(108));
|
||||
@@ -4613,14 +4611,12 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[serial]
|
||||
fn test_initial_scanner_delay_skips_for_cold_usage_cache_with_buckets() {
|
||||
let delay = initial_scanner_delay_for_startup(Some(120), true, true, false);
|
||||
assert_eq!(delay, Duration::ZERO);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[serial]
|
||||
fn test_initial_scanner_delay_keeps_configured_delay_for_warm_usage_cache_no_replication() {
|
||||
let delay = initial_scanner_delay_for_startup(Some(120), false, true, false);
|
||||
assert!(delay >= Duration::from_secs(108));
|
||||
@@ -4628,14 +4624,12 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[serial]
|
||||
fn test_initial_scanner_delay_skips_for_cold_usage_cache_without_buckets() {
|
||||
let delay = initial_scanner_delay_for_startup(Some(120), true, false, false);
|
||||
assert_eq!(delay, Duration::ZERO);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[serial]
|
||||
fn test_initial_scanner_delay_skips_for_active_replication_warm_cache() {
|
||||
// Warm cache + active replication rules → skip startup delay so that FAILED-status objects
|
||||
// from a crash are healed on the first cycle, not after a 27-33 min sleep.
|
||||
@@ -4644,7 +4638,6 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[serial]
|
||||
fn test_initial_scanner_delay_keeps_delay_for_replication_without_buckets() {
|
||||
// Active replication but no buckets → no objects to scan, keep normal delay.
|
||||
let delay = initial_scanner_delay_for_startup(Some(120), false, false, true);
|
||||
@@ -7399,7 +7392,6 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[serial]
|
||||
fn clean_idle_cap_allows_policy_max_when_bitrot_is_disabled() {
|
||||
let config = ScannerRuntimeConfig {
|
||||
bitrot_cycle: None,
|
||||
@@ -7515,7 +7507,6 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[serial]
|
||||
fn test_randomized_cycle_delay_handles_small_start_delay() {
|
||||
// 0 is treated as minimum 1 second before jitter, with lower bound preserved.
|
||||
let delay = randomized_cycle_delay_for(Duration::from_secs(0));
|
||||
@@ -8174,7 +8165,6 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[serial]
|
||||
fn test_background_heal_info_for_scan_complete_marks_deep_idle() {
|
||||
let started_at = Utc::now();
|
||||
let info = BackgroundHealInfo {
|
||||
@@ -8192,7 +8182,6 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[serial]
|
||||
fn test_background_heal_info_for_scan_complete_leaves_normal_scan_unchanged() {
|
||||
let info = BackgroundHealInfo {
|
||||
bitrot_start_time: Some(Utc::now()),
|
||||
@@ -8204,7 +8193,6 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[serial]
|
||||
fn test_background_heal_info_for_failed_scan_preserves_deep_mode() {
|
||||
let info = BackgroundHealInfo {
|
||||
bitrot_start_time: Some(Utc::now()),
|
||||
|
||||
Reference in New Issue
Block a user