Skip to content

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

test(cron): add timing probes and relax backoff assertion

Steven Enamakelfea79bfc7d48
diff --git a/crates/openhuman-core/src/cron/scheduler_dispatch_tests.rs b/crates/openhuman-core/src/cron/scheduler_dispatch_tests.rs
index 604e53b6a9..5070c5b9a5 100644
--- a/crates/openhuman-core/src/cron/scheduler_dispatch_tests.rs
+++ b/crates/openhuman-core/src/cron/scheduler_dispatch_tests.rs
@@ -231,10 +231,13 @@ async fn an_upgraded_job_with_a_side_table_policy_keeps_firing_with_it() {
}
// The storage importer brings the legacy rows (and their side-table policy) over.
+ let t0 = std::time::Instant::now();
let backend = crate::storage::local::backend_for(&config.workspace_dir).unwrap();
+ eprintln!("PROBE backend {:?}", t0.elapsed());
for report in crate::storage::import::tinyflows::run_with(&backend, &config) {
report.outcome.unwrap();
}
+ eprintln!("PROBE imported {:?}", t0.elapsed());
force_due(&config, shell_id);
let job = cron::get_job(&config, shell_id).unwrap();
assert_eq!(job.policy.retries, Some(0));
@@ -245,8 +248,11 @@ async fn an_upgraded_job_with_a_side_table_policy_keeps_firing_with_it() {
&config,
&security(&config),
);
+ eprintln!("PROBE before tick {:?}", t0.elapsed());
dispatcher.tick(&config).await.unwrap();
+ eprintln!("PROBE ticked {:?}", t0.elapsed());
dispatcher.drain().await;
+ eprintln!("PROBE drained {:?}", t0.elapsed());
let after = cron::get_job(&config, shell_id).unwrap();
assert_eq!(
diff --git a/crates/openhuman-core/src/cron/scheduler_tests.rs b/crates/openhuman-core/src/cron/scheduler_tests.rs
index 297df0ccbd..a9a723e9ef 100644
--- a/crates/openhuman-core/src/cron/scheduler_tests.rs
+++ b/crates/openhuman-core/src/cron/scheduler_tests.rs
@@ -261,7 +261,7 @@ async fn security_policy_block_halts_without_spending_the_retry_budget() {
attempt_count(&counter)
);
assert!(
- elapsed < std::time::Duration::from_secs(1),
+ elapsed < std::time::Duration::from_millis(config.reliability.provider_backoff_ms),
"the loop slept for {elapsed:?} on a deterministic policy refusal. A security block is \
permanent across the backoff curve and must return on the first attempt; retrying it \
only delays the user's error by the full retry budget (here about 4 s)."