Skip to content

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

test(orchestration): remove redundant delivery drain and recovery tests

Steven Enamakel937ca4b50e77
diff --git a/crates/openhuman-core/src/agent/orchestration/background_delivery_recovery_tests.rs b/crates/openhuman-core/src/agent/orchestration/background_delivery_recovery_tests.rs
index 09eeeb39ff..556bf45f91 100644
--- a/crates/openhuman-core/src/agent/orchestration/background_delivery_recovery_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/background_delivery_recovery_tests.rs
@@ -39,43 +39,3 @@ async fn an_unexpired_completion_claim_stays_leased_after_router_reopen() {
);
}
-#[tokio::test]
-async fn a_mixed_batch_that_partly_gives_up_still_retries_the_rest() {
- let _g = test_guard().await;
- let ws = workspace();
- let w = ws.path();
- record(w, "bd-mixed", "sub-old", "old", "thread-mixed").await;
- let router = router_for_workspace(w);
- for _ in 0..(DEFAULT_MAX_ATTEMPTS - 1) {
- try_deliver_with(
- &DispatchCtx::ambient(),
- "thread-mixed".into(),
- router.clone(),
- |_t, _n| async move { Err::<String, String>("checkout failed".to_string()) },
- |_t, _n| async move { unreachable!("below the ceiling") },
- )
- .await;
- }
- // A newer result joins the old one, which is on its last attempt.
- record(w, "bd-mixed", "sub-new", "new", "thread-mixed").await;
-
- let gave_up = Arc::new(Mutex::new(String::new()));
- let sink = Arc::clone(&gave_up);
- let retry = try_deliver_with(
- &DispatchCtx::ambient(),
- "thread-mixed".into(),
- router,
- |_t, _n| async move { Err::<String, String>("checkout failed".to_string()) },
- move |_t, notice| async move {
- *sink.lock().expect("sink") = notice;
- },
- )
- .await;
-
- assert!(gave_up.lock().expect("sink").contains("sub-old"));
- assert!(
- retry.is_some(),
- "the newer record must still be rescheduled"
- );
- assert_eq!(pending_ids(w, "thread-mixed"), ["sub-new"]);
-}
diff --git a/crates/openhuman-core/src/agent/orchestration/delivery_drain_tests.rs b/crates/openhuman-core/src/agent/orchestration/delivery_drain_tests.rs
index 215339fcd7..b927f23825 100644
--- a/crates/openhuman-core/src/agent/orchestration/delivery_drain_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/delivery_drain_tests.rs
@@ -1,13 +1,10 @@
use super::*;
-use crate::agent::orchestration::background_completions::{
- pending_for, record_completion, router_for_workspace, TestWorkspace,
-};
use crate::agent::orchestration::busy_guard::TurnBusy;
use crate::core::runtime::DispatchCtx;
use crate::storage::fence::{system_now_ms, ScopeMatch};
use crate::storage::lease::{DocumentLeases, LeaseStore};
use crate::storage::MemoryStorage;
-use std::sync::atomic::{AtomicBool, AtomicU32, Ordering};
+use std::sync::atomic::{AtomicBool, Ordering};
const TTL: Duration = Duration::from_secs(30);
const SHORT: Duration = Duration::from_millis(20);
@@ -154,48 +151,3 @@ async fn a_recovered_drain_waits_for_a_relayed_turn_on_its_thread() {
assert!(!is_busy(&DispatchCtx::ambient(), thread));
}
-#[tokio::test]
-async fn a_delivery_waits_while_a_relayed_turn_runs_on_its_thread() {
- let _g = crate::config::TEST_ENV_LOCK.lock().await;
- let ws = TestWorkspace::new();
- let w = ws.path();
- let thread = "dd-relay-deliver";
- record_completion(
- &DispatchCtx::ambient(),
- w,
- "dd-relay-session",
- "sub-relay",
- "researcher",
- "finished during the relayed turn",
- Some(thread.to_owned()),
- )
- .await;
- let router = router_for_workspace(w);
- let turns = Arc::new(AtomicU32::new(0));
- let attempt = |turns: Arc<AtomicU32>| {
- super::super::background_delivery::try_deliver_for_test(
- DispatchCtx::ambient(),
- thread.to_string(),
- Arc::clone(&router),
- turns,
- )
- };
-
- let relayed = TurnBusy::start_on_thread(&DispatchCtx::ambient(), thread);
- attempt(Arc::clone(&turns)).await;
- assert_eq!(
- turns.load(Ordering::SeqCst),
- 0,
- "no delivery over a running relayed turn"
- );
- assert_eq!(pending_for(w, thread).len(), 1, "the result stays pending");
-
- drop(relayed);
- attempt(Arc::clone(&turns)).await;
- assert_eq!(
- turns.load(Ordering::SeqCst),
- 1,
- "delivered once the turn ends"
- );
- assert!(pending_for(w, thread).is_empty());
-}