Skip to content

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

test(storage): hoist session scope before lease takeover

Steven Enamakel05f5d30d17f6
diff --git a/crates/openhuman-core/src/storage/fenced_backend_upstream_tests.rs b/crates/openhuman-core/src/storage/fenced_backend_upstream_tests.rs
index 551439d2b7..5b7dc2135c 100644
--- a/crates/openhuman-core/src/storage/fenced_backend_upstream_tests.rs
+++ b/crates/openhuman-core/src/storage/fenced_backend_upstream_tests.rs
@@ -98,6 +98,7 @@ async fn a_node_that_lost_the_lease_cannot_write_and_the_new_holder_can() {
a.take("alice").await;
a.put("profile:alice", "n1").await.unwrap();
a.put("alice~default", "n1").await.unwrap();
+ let session = a.scoped("alice~default");
// Node B's clock passes A's expiry and takes the profile over. Node A's
// clock is still early (it was paused, or runs behind): its local check
@@ -113,7 +114,6 @@ async fn a_node_that_lost_the_lease_cannot_write_and_the_new_holder_can() {
Some(FenceError::Superseded { .. })
));
// Every write port, and every session scope of the profile, is fenced.
- let session = a.scoped("alice~default");
assert!(session.streams().append("log", json!(1)).await.is_err());
assert!(session.blobs().put("k", b"x".to_vec(), None).await.is_err());
assert!(session