Skip to content

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

chore: files changed crates/openhuman-core/src/storage/import_state_tests.rs

Steven Enamakeld3e0247a9195
diff --git a/crates/openhuman-core/src/storage/import_state_tests.rs b/crates/openhuman-core/src/storage/import_state_tests.rs
index c5f1c52aee..b96bf5bc52 100644
--- a/crates/openhuman-core/src/storage/import_state_tests.rs
+++ b/crates/openhuman-core/src/storage/import_state_tests.rs
@@ -232,16 +232,14 @@ fn a_waiting_process_runs_once_the_holder_releases() {
fn a_long_import_keeps_its_claim_alive() {
let repo = repo();
let now = chrono::Utc::now().timestamp_millis();
- // 2s lease, body runs 4s: without renewal a rival would take over. The
- // lease is long enough that a loaded machine starving the renewal thread for
- // a few hundred ms does not read as a lapse.
+ // 90ms lease, body runs 400ms: without renewal a rival would take over.
let rival_repo = repo.clone();
- let rival_ran = with_claim_at(&repo, OWNER, "m", now, 2000, || {
+ let rival_ran = with_claim_at(&repo, OWNER, "m", now, 90, || {
let mut took_over = false;
- for _ in 0..4 {
- std::thread::sleep(std::time::Duration::from_millis(1000));
+ for _ in 0..8 {
+ std::thread::sleep(std::time::Duration::from_millis(50));
let at = chrono::Utc::now().timestamp_millis();
- took_over |= with_claim_at(&rival_repo, OWNER, "m", at, 2000, || Ok(()))
+ took_over |= with_claim_at(&rival_repo, OWNER, "m", at, 90, || Ok(()))
.unwrap()
.is_some();
}