Skip to content

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

test(config): run the profile refresh test on a storage-backed lease

M3gA-Mindc3f9872b69ee
diff --git a/crates/openhuman-core/src/config/schema/load/source/profile_refresh_tests.rs b/crates/openhuman-core/src/config/schema/load/source/profile_refresh_tests.rs
index b726efb2d1..f6754d8dbc 100644
--- a/crates/openhuman-core/src/config/schema/load/source/profile_refresh_tests.rs
+++ b/crates/openhuman-core/src/config/schema/load/source/profile_refresh_tests.rs
@@ -1,5 +1,6 @@
use super::*;
+#[cfg(feature = "storage-sqlite")]
#[tokio::test]
async fn profile_context_conflict_refresh_keeps_host_owned_restrictions() {
let tmp = tempfile::tempdir().unwrap();
@@ -11,7 +12,15 @@ async fn profile_context_conflict_refresh_keeps_host_owned_restrictions() {
);
let operator = CoreContext::for_test(DomainSet::full(), None);
let saas = crate::core::runtime::SaasConfig::new(tmp.path());
- let host = crate::profiles::ProfileHost::new(saas, operator);
+ // A storage-backed lease, so the profile fence carries an atomic write
+ // condition: the fenced backend refuses unguarded (file-lease) handles.
+ let fixture = crate::storage::test_support::sqlite_backend().unwrap();
+ let backend: Arc<dyn tinystoragedrivers::StorageBackend> = Arc::clone(&fixture.backend);
+ let host = crate::profiles::ProfileHost::with_backend(saas, operator, Some(backend))
+ .unwrap()
+ .with_fences(Arc::new(crate::storage::fence::FenceRegistry::new(
+ crate::profiles::lease::now_ms,
+ )));
let id = crate::profiles::ProfileId::for_user(
"profile-refresh",
crate::profiles::ProfileIdMode::Raw,