Skip to content

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

test(profiles): assert fence latch directly in takeover test

Steven Enamakel71f6784cc2dc
diff --git a/crates/openhuman-core/src/profiles/fence_tests.rs b/crates/openhuman-core/src/profiles/fence_tests.rs
index ba0d66c8a9..7697706bb9 100644
--- a/crates/openhuman-core/src/profiles/fence_tests.rs
+++ b/crates/openhuman-core/src/profiles/fence_tests.rs
@@ -102,15 +102,9 @@ async fn a_takeover_fences_the_old_holders_writes_before_its_heartbeat_runs() {
Some(FenceError::Superseded { .. })
));
assert!(state.is_fenced());
- // ... so new work is refused under its context, even before the
- // heartbeat closes it.
- let refused_turn = CoreContext::scope(Arc::clone(state.context()), async {
- crate::profiles::host::ensure_hosted()
- })
- .await;
- // `ensure_hosted` reads the process host, which tests do not install;
- // the latch it consults is the one asserted above.
- let _ = refused_turn;
+ // ... so new work is refused for it (`ensure_hosted` reads this latch)
+ // even before the heartbeat closes it.
+ assert!(state.lease_fence().check_local(now_ms()).is_err());
// The heartbeat closes it; the latched fence stays registered (refusing
// writes) while the profile's state is still held.