Skip to content

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

chore: files changed crates/openhuman-core/src/storage/agents_tests.rs,tests/storage_scope_e2e.rs

Steven Enamakelb83229b0ab51
diff --git a/crates/openhuman-core/src/storage/agents_tests.rs b/crates/openhuman-core/src/storage/agents_tests.rs
index eb593ee20e..67fc428d45 100644
--- a/crates/openhuman-core/src/storage/agents_tests.rs
+++ b/crates/openhuman-core/src/storage/agents_tests.rs
@@ -143,7 +143,10 @@ async fn without_a_backend_only_the_local_scope_runs() {
Ok(None),
"nothing anywhere"
);
- assert_eq!(find_owner("test", || async { Ok(true) }).await, Ok(Some(None)));
+ assert_eq!(
+ find_owner("test", || async { Ok(true) }).await,
+ Ok(Some(None))
+ );
assert!(
find_owner("test", || async { Err("down".to_string()) })
.await
@@ -178,7 +181,10 @@ fn the_first_scope_reporting_the_record_owns_it() {
(Some("b".into()), Ok(true)),
]);
assert_eq!(found, Ok(Some(Some("b".to_string()))));
- let failed = decide(vec![(None, Ok(false)), (Some("a".into()), Err("down".into()))]);
+ let failed = decide(vec![
+ (None, Ok(false)),
+ (Some("a".into()), Err("down".into())),
+ ]);
let failed = failed.unwrap_err();
assert_eq!(failed.agent.as_deref(), Some("a"));
assert_eq!(failed.to_string(), "lookup failed in scope a: down");
diff --git a/tests/storage_scope_e2e.rs b/tests/storage_scope_e2e.rs
index 71c6ba29e5..75800159e1 100644
--- a/tests/storage_scope_e2e.rs
+++ b/tests/storage_scope_e2e.rs
@@ -80,11 +80,18 @@ async fn background_work_visits_every_agent_scope() {
let job_id = within_agent(Some("agent-e2e"), async {
cron::list_jobs(&config).unwrap()[0].id.clone()
})
+ .await
+ .expect("the live agent has a context");
+ let owner = find_owner("e2e", || async {
+ Ok(cron::get_job(&config, &job_id).is_ok())
+ })
+ .await;
+ assert_eq!(owner, Ok(Some(Some("agent-e2e".to_string()))));
+ let missing = find_owner("e2e", || async {
+ Ok(cron::get_job(&config, "nope").is_ok())
+ })
.await;
- let owner = find_owner("e2e", || async { cron::get_job(&config, &job_id).is_ok() }).await;
- assert_eq!(owner, Some(Some("agent-e2e".to_string())));
- let missing = find_owner("e2e", || async { cron::get_job(&config, "nope").is_ok() }).await;
- assert_eq!(missing, None);
+ assert_eq!(missing, Ok(None));
// … and, once the agent is gone, through the id the backend recorded.
assert!(AgentContextRegistry::deregister("agent-e2e", &agent));