From 6d0583872bf3f0465f19863b8d75ca58a26e6a19 Mon Sep 17 00:00:00 2001 From: houseme Date: Tue, 7 Jul 2026 04:18:56 +0800 Subject: [PATCH] test(ecstore): serialize list_objects mutation-sequence tests (#4338) Three tests share the global list-objects mutation-sequence state (the LIST_OBJECTS_MUTATION_SEQUENCE atomic and the per-bucket sequence map) and all call reset_list_objects_mutation_sequences_for_test(), but only observed_mutation_persists_namespace_journal_high_water was marked #[serial_test::serial]. The serial lock only excludes tests that also carry the attribute, so the unmarked tests still ran concurrently with it: the journal test's persist of "bucket" -> 11 could land after the recovery test's reset, making it observe 11 instead of the expected 9 (flaky under the default multi-threaded test runner, green with --test-threads=1). Add #[serial_test::serial] to the two unmarked tests: - persistent_key_only_index_load_recovers_mutation_sequence_from_journal - list_objects_mutation_sequence_advances_per_bucket Unique bucket names alone would not fix this: the per-bucket assertions in list_objects_mutation_sequence_advances_per_bucket check exact values produced by the single global atomic counter, which any concurrent observe call perturbs, and every reset zeroes that global state for whichever peer is mid-flight. Co-authored-by: heihutu --- crates/ecstore/src/store/list_objects.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/ecstore/src/store/list_objects.rs b/crates/ecstore/src/store/list_objects.rs index e6695fb3c..49ce6cac1 100644 --- a/crates/ecstore/src/store/list_objects.rs +++ b/crates/ecstore/src/store/list_objects.rs @@ -7667,6 +7667,7 @@ mod test { } #[tokio::test] + #[serial_test::serial] async fn persistent_key_only_index_load_recovers_mutation_sequence_from_journal() { let tempdir = tempfile::tempdir().expect("tempdir should be created"); let index_path = tempdir.path().join("persistent-key-only.index"); @@ -7786,6 +7787,7 @@ mod test { } #[tokio::test] + #[serial_test::serial] async fn list_objects_mutation_sequence_advances_per_bucket() { reset_list_objects_mutation_sequences_for_test().await;