Skip to content

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

test(web_chat): await bridge spawn in heartbeat tests

Steven Enamakel77b08ca80c83
diff --git a/crates/openhuman-core/src/web_chat/progress_tests.rs b/crates/openhuman-core/src/web_chat/progress_tests.rs
index 3d8d540425..a30c987689 100644
--- a/crates/openhuman-core/src/web_chat/progress_tests.rs
+++ b/crates/openhuman-core/src/web_chat/progress_tests.rs
@@ -230,12 +230,11 @@ async fn spawn_test_bridge_with_interval(
/// "no response after 2 minutes" timeout (#4270).
#[tokio::test]
async fn emits_inference_heartbeat_while_turn_in_flight() {
- let _module = crate::channels::module_fixture::client().await;
let mut events = crate::web_chat::subscribe_web_channel_events();
let thread_id = "thread-hb-emit-4270";
let request_id = "req-hb-emit-4270";
let (tx, task) =
- spawn_test_bridge_with_interval(thread_id, request_id, Duration::from_millis(50));
+ spawn_test_bridge_with_interval(thread_id, request_id, Duration::from_millis(50)).await;
// Turn begins — arms the liveness beat.
tx.send(AgentProgress::TurnStarted).await.unwrap();
@@ -273,11 +272,14 @@ async fn emits_inference_heartbeat_while_turn_in_flight() {
/// the channel-closed `break`.
#[tokio::test]
async fn stops_heartbeat_after_turn_completed() {
- let _module = crate::channels::module_fixture::client().await;
let mut events = crate::web_chat::subscribe_web_channel_events();
let thread_id = "thread-hb-stop-4270";
- let (tx, task) =
- spawn_test_bridge_with_interval(thread_id, "req-hb-stop-4270", Duration::from_millis(50));
+ let (tx, task) = spawn_test_bridge_with_interval(
+ thread_id,
+ "req-hb-stop-4270",
+ Duration::from_millis(50),
+ )
+ .await;
tx.send(AgentProgress::TurnStarted).await.unwrap();
// Drain through the first heartbeat to prove the turn was beating.