Skip to content

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

chore: files changed src/openhuman/integrations/composio/module_client.rs,src/openhuman/integrations\n\nAuto-committed-on: dragonfly\n

Steven Enamakel2ab7e30f956d
diff --git a/src/openhuman/integrations/composio/module_client.rs b/src/openhuman/integrations/composio/module_client.rs
index 606dc1a297..dc67fca406 100644
--- a/src/openhuman/integrations/composio/module_client.rs
+++ b/src/openhuman/integrations/composio/module_client.rs
@@ -109,6 +109,31 @@ pub async fn call_bare<Reply: serde::de::DeserializeOwned>(
Err(format!("{member}: {WITHOUT_MODULES}"))
}
+/// Serializes every test that reaches the connector module.
+///
+/// The module is loaded once per process and holds exactly one route, but each
+/// test that exercises it stands up its own mock backend on its own port and
+/// points the module at it. Run in parallel they reconfigure each other
+/// mid-call, and the failure surfaces as a 404 from somebody else's mock —
+/// which reads like a bug in the code under test rather than as a race.
+///
+/// This did not exist before the connector extraction, because each test built
+/// its own client. Sharing one module instance is the price of the module
+/// being real in these tests rather than mocked, and they are worth more for
+/// it: they exercise the loader, the bus, and the module's own dispatch.
+///
+/// It lives here rather than in one test module because the tests that need it
+/// are spread across `ops_tests` and the flow adapter's own suite, and two
+/// locks would serialize neither against the other.
+#[cfg(test)]
+pub(crate) static MODULE_LOCK: tokio::sync::Mutex<()> = tokio::sync::Mutex::const_new(());
+
+/// Take the module lock for the rest of the test.
+#[cfg(test)]
+pub(crate) async fn module_guard() -> tokio::sync::MutexGuard<'static, ()> {
+ MODULE_LOCK.lock().await
+}
+
#[cfg(test)]
#[path = "module_client_tests.rs"]
mod tests;
diff --git a/src/openhuman/integrations/composio/ops_tests.rs b/src/openhuman/integrations/composio/ops_tests.rs
index 3a4909e573..99120c9ad1 100644
--- a/src/openhuman/integrations/composio/ops_tests.rs
+++ b/src/openhuman/integrations/composio/ops_tests.rs
@@ -28,24 +28,7 @@ fn parse_sync_reason_rejects_unknown_values() {
assert!(parse_sync_reason(Some("")).is_err());
}
-/// Serializes every test that reaches the connector module.
-///
-/// The module is loaded once per process and holds exactly one route, but each
-/// test below stands up its own mock backend on its own port and points the
-/// module at it. Run in parallel they reconfigure each other mid-call, and the
-/// failure surfaces as a 404 from somebody else's mock — which reads like a
-/// bug in the code under test rather than as a race.
-///
-/// This did not exist before the extraction because each test built its own
-/// client. Sharing one module instance is the price of the module being real
-/// here rather than mocked, and these tests are worth more for it: they
-/// exercise the loader, the bus, and the module's own dispatch.
-static MODULE_LOCK: tokio::sync::Mutex<()> = tokio::sync::Mutex::const_new(());
-
-/// Take the module lock for the rest of the test.
-async fn module_guard() -> tokio::sync::MutexGuard<'static, ()> {
- MODULE_LOCK.lock().await
-}
+use crate::openhuman::integrations::composio::module_client::module_guard;
// ── resolve_client / ops auth errors ──────────────────────────