Skip to content

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

test(channels): assert callback context identity and tenant

Steven Enamakelf8f30bd97f54
diff --git a/crates/openhuman-core/src/channels/routes_tests.rs b/crates/openhuman-core/src/channels/routes_tests.rs
index 3b4ded07d4..73a031a1f0 100644
--- a/crates/openhuman-core/src/channels/routes_tests.rs
+++ b/crates/openhuman-core/src/channels/routes_tests.rs
@@ -235,6 +235,7 @@ impl Wake for NoopWake {
async fn sign_out_cancels_remote_invalidation_while_it_waits_for_the_session_table() {
let core_context =
crate::core::runtime::CoreContext::for_test(crate::core::runtime::DomainSet::full(), None);
+ let expected_core_context = Arc::clone(&core_context);
crate::core::runtime::CoreContext::scope(core_context, async {
let guard = crate::web_chat::ops::lock_thread_sessions_for_test().await;
let cancellation = tokio_util::sync::CancellationToken::new();
@@ -242,7 +243,11 @@ async fn sign_out_cancels_remote_invalidation_while_it_waits_for_the_session_tab
runtime_context(PathBuf::from("/tmp/channel-callback")),
cancellation.clone(),
);
- assert!(callback.core_context.is_some());
+ assert!(Arc::ptr_eq(
+ callback.core_context.as_ref().unwrap(),
+ &expected_core_context
+ ));
+ assert_eq!(callback.tenant, crate::core::runtime::Tenant::default());
let request = tinychannels_bus::ChannelBackendRequest::RemoteControl(
tinychannels_bus::module_remote::RemoteHostRequest::InvalidateThread {