test: keep native backlog fault errors typed

This commit is contained in:
overtrue
2026-09-09 11:19:39 +08:00
parent 15e5ca4f17
commit bf63edac4b
@@ -201,6 +201,12 @@ pub mod test_util {
use std::sync::atomic::{AtomicUsize, Ordering};
use tokio::sync::Notify;
#[derive(Debug, thiserror::Error)]
#[error("injected native scanner backlog {phase} write failure")]
struct InjectedWriteFailure {
phase: &'static str,
}
pub(super) struct WriteFault {
set: Arc<SetDisks>,
phase: &'static str,
@@ -279,7 +285,7 @@ pub mod test_util {
return Ok(None);
}
if fault.fail_before_write {
return Err(Error::other(format!("injected native scanner backlog {phase} write failure")));
return Err(Error::other(InjectedWriteFailure { phase }));
}
Ok(Some(fault))
}