Skip to content

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

test(cron): update admission error assertions to match TinyBus message

Steven Enamakelca1a728c10c5
diff --git a/crates/openhuman-core/src/cron/limits_tests.rs b/crates/openhuman-core/src/cron/limits_tests.rs
index 970756bb16..3a27eacdb2 100644
--- a/crates/openhuman-core/src/cron/limits_tests.rs
+++ b/crates/openhuman-core/src/cron/limits_tests.rs
@@ -192,8 +192,11 @@ fn concurrent_preflight_admissions_cannot_oversubscribe_the_store_cap() {
.iter()
.find_map(|result| result.as_ref().err())
.unwrap();
+ // TinyBus keeps the module's public insert context, not its anyhow source chain.
assert!(
- rejected.to_string().contains("active job limit"),
+ rejected
+ .to_string()
+ .contains("Failed to insert cron agent job"),
"unexpected admission error: {rejected}"
);
assert_eq!(crate::cron::list_jobs(&config).unwrap().len(), 1);
diff --git a/crates/openhuman-core/src/profiles/host_tests.rs b/crates/openhuman-core/src/profiles/host_tests.rs
index 59bcd03b36..568dd2b879 100644
--- a/crates/openhuman-core/src/profiles/host_tests.rs
+++ b/crates/openhuman-core/src/profiles/host_tests.rs
@@ -442,10 +442,9 @@ async fn provisioning_installs_the_cron_cap_in_the_profile_scope() {
let second =
crate::cron::client::store_in::<crate::cron::CronJob>(&config, &scope, operation()).await;
let error = second.expect_err("the profile store must enforce its provisioned cap");
- assert!(
- error.to_string().contains("active job limit"),
- "unexpected admission error: {error}"
- );
+ assert!(error
+ .to_string()
+ .contains("Failed to insert cron agent job"));
}
#[tokio::test]
@@ -480,7 +479,9 @@ async fn opening_an_existing_profile_adopts_the_enforced_cron_cap() {
)
.await;
let error = second.expect_err("opening a profile should adopt the configured cron cap");
- assert!(error.to_string().contains("active job limit"), "{error}");
+ assert!(error
+ .to_string()
+ .contains("Failed to insert cron agent job"));
}
#[tokio::test]