Skip to content

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

test(mcp): update cleanup tests for lifecycle table API

Steven Enamakel6e10fa07bf09
diff --git a/crates/openhuman-core/src/mcp/module_client_cleanup_tests.rs b/crates/openhuman-core/src/mcp/module_client_cleanup_tests.rs
index 1cdb2fdcbd..15db7668c7 100644
--- a/crates/openhuman-core/src/mcp/module_client_cleanup_tests.rs
+++ b/crates/openhuman-core/src/mcp/module_client_cleanup_tests.rs
@@ -114,11 +114,7 @@ async fn failed_cleanup_actions_retain_and_retry_cached_and_orphaned_paths() {
std::fs::remove_dir_all(&orphan_home).is_ok() || !orphan_home.exists()
}),
);
- assert!(!McpConfiguredClient::finish_cleanup(
- &orphan_dir,
- None,
- reservation,
- ));
+ assert!(!lifecycle::table().finish_cleanup(&orphan_dir, None, &reservation,));
assert!(McpConfiguredClient::agent_close_pending(&orphan_dir));
assert!(orphan_dir.exists());
lifecycle::table().retry_orphaned();
diff --git a/crates/openhuman-core/src/mcp/module_client_owner_tests.rs b/crates/openhuman-core/src/mcp/module_client_owner_tests.rs
index d0eb350325..cd064dac85 100644
--- a/crates/openhuman-core/src/mcp/module_client_owner_tests.rs
+++ b/crates/openhuman-core/src/mcp/module_client_owner_tests.rs
@@ -91,7 +91,7 @@ async fn failed_agent_cleanup_retains_the_retired_owner_and_can_retry() {
);
fixture.fail_close.store(false, Ordering::SeqCst);
cleanup.finish().await.unwrap();
- assert!(!cached(&directory).is_some());
+ assert!(cached(&directory).is_none());
// Retrying the old completed handle cannot evict a later owner.
let successor = Arc::new(McpConfiguredClient::new(&directory, &Config::default()).unwrap());
lifecycle::table().insert(directory.clone(), Arc::clone(&successor));
@@ -355,7 +355,7 @@ async fn a_blocked_close_has_an_overall_cleanup_deadline_and_keeps_the_owner_for
fixture.release_close.notify_one();
cleanup.finish().await.unwrap();
assert_eq!(fixture.closes.load(Ordering::SeqCst), 2);
- assert!(!cached(&directory).is_some());
+ assert!(cached(&directory).is_none());
}
#[test]