Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test(ops): cover terminal marker appearing once in loader errors

Steven Enamakel9498051a8fa4
diff --git a/crates/openhuman-core/src/modules/ops_tests.rs b/crates/openhuman-core/src/modules/ops_tests.rs
index 117a5c2563..1923a67285 100644
--- a/crates/openhuman-core/src/modules/ops_tests.rs
+++ b/crates/openhuman-core/src/modules/ops_tests.rs
@@ -312,6 +312,29 @@ fn load_errors_render_for_callers_that_cannot_wait_again() {
assert!(message.contains("still loading"), "{message}");
}
+#[tokio::test]
+async fn a_loader_error_carries_the_terminal_marker_exactly_once() {
+ // `blocking` marks a loader error terminal, but tinybus' release-cache path
+ // and `load_local` already say so; appending again doubled the sentence.
+ // The failure policy keys on both phrases, so each must stay, once.
+ let marker = crate::tools::status::MODULE_FAULT_MARKER;
+ for loader_error in [
+ "module 'tinydocs' could not be loaded: digest mismatch. This is terminal for the \
+ running process; restart the app to try again",
+ "module 'tinydocs' could not be loaded from the installer bundle: refused. Restart the \
+ app after repairing the installation",
+ ] {
+ let owned = loader_error.to_string();
+ let error = ops::blocking(move || Err(owned)).await.unwrap_err();
+ assert_eq!(error.matches(marker).count(), 1, "{error}");
+ assert_eq!(
+ error.matches("restart the app to try again").count(),
+ 1,
+ "{error}"
+ );
+ }
+}
+
/// The Sentry payload of TAURI-RUST-117K: a load refused at admission, with the
/// terminal marker the loader adds.
const REFUSED_LOAD: &str = "module 'tinyconnectors' could not be loaded from the installer \