fix(tests): stabilize main CI concurrency fixtures (#6655)

* fix(tests): retry transient inventory replacement failures

* test(rio): isolate h2 keepalive fixture runtime
This commit is contained in:
Zhengchao An
2026-08-26 18:16:47 +08:00
committed by GitHub
parent 5a424219d2
commit ff47714363
2 changed files with 77 additions and 30 deletions
+14 -1
View File
@@ -1805,7 +1805,20 @@ mod tests {
second_writer.clone()
};
let bytes = encode_envelope(snapshot, captured_at.to_owned()).expect("envelope");
writer.replace_file("latest.json", &bytes, || false).expect("atomic replace");
let mut committed = false;
for _ in 0..100 {
match writer.replace_file("latest.json", &bytes, || false) {
Ok(()) => {
committed = true;
break;
}
Err(InventoryError::StateIo | InventoryError::PersistenceSecurity) => {
std::thread::sleep(std::time::Duration::from_millis(1));
}
Err(error) => panic!("atomic replace: {error}"),
}
}
assert!(committed, "atomic replace did not recover from transient fail-closed errors");
}
});
let now = chrono::DateTime::parse_from_rfc3339(captured_at)