Skip to content

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

test(security): add approval store document tests

Steven Enamakeld451c9072947
diff --git a/crates/openhuman-core/src/security/approval/store_documents_tests.rs b/crates/openhuman-core/src/security/approval/store_documents_tests.rs
index 9738742c61..1448115ef0 100644
--- a/crates/openhuman-core/src/security/approval/store_documents_tests.rs
+++ b/crates/openhuman-core/src/security/approval/store_documents_tests.rs
@@ -353,15 +353,15 @@ fn an_unresolved_scope_fails_the_captured_decide_instead_of_using_another_scope(
}
#[test]
-fn expiry_is_compared_below_a_millisecond() {
+fn expiry_is_compared_in_epoch_milliseconds() {
let store = docs();
let whole = Utc::now().with_nanosecond(0).unwrap();
- let due = whole + Duration::nanoseconds(900_000);
+ let due = whole + Duration::milliseconds(3);
let mut p = pending("tight", 0, None);
p.expires_at = Some(due);
store.insert_pending(&p, "s").unwrap();
assert!(store
- .expire_stale(whole + Duration::nanoseconds(100_000))
+ .expire_stale(whole + Duration::milliseconds(2))
.unwrap()
.is_empty());
assert_eq!(store.expire_stale(due).unwrap().len(), 1);