Skip to content

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

test(openhuman-embed): scope reopened session lock to a block

Steven Enamakelaf2f0d45b5b0
diff --git a/crates/openhuman-embed/tests/profile_host_capabilities.rs b/crates/openhuman-embed/tests/profile_host_capabilities.rs
index d129db0685..dee9d24b8c 100644
--- a/crates/openhuman-embed/tests/profile_host_capabilities.rs
+++ b/crates/openhuman-embed/tests/profile_host_capabilities.rs
@@ -472,15 +472,16 @@ async fn scenario() {
("alice".into(), "reopened-message".into())
]
);
- let reopened_sessions = sessions.lock().unwrap();
- assert_eq!(
- &reopened_sessions[reopened_sessions.len() - 2..],
- [
- ("alice".into(), Some("t1".into())),
- ("alice".into(), Some("channel:telegram/sender/chat".into()))
- ]
- );
- drop(reopened_sessions);
+ {
+ let reopened_sessions = sessions.lock().unwrap();
+ assert_eq!(
+ &reopened_sessions[reopened_sessions.len() - 2..],
+ [
+ ("alice".into(), Some("t1".into())),
+ ("alice".into(), Some("channel:telegram/sender/chat".into()))
+ ]
+ );
+ }
handles.insert(0, reopened);
let alice_profile = handles[0]
.scope(async { openhuman_core::profiles::current().unwrap() })