Skip to content

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

test(e2e): add memory module support and settle waits in e2e tests

Steven Enamakeld226bb64e2a8
diff --git a/tests/domain_modules_e2e.rs b/tests/domain_modules_e2e.rs
index 7306b74f13..3b5eaf988a 100644
--- a/tests/domain_modules_e2e.rs
+++ b/tests/domain_modules_e2e.rs
@@ -5,6 +5,9 @@
//! exercises cheap read/status handlers through HTTP. Mutating or networked
//! domain behavior remains covered by the focused `*_e2e.rs` suites.
+#[path = "support/memory_module.rs"]
+mod memory_module;
+
use std::net::SocketAddr;
use std::path::Path;
use std::sync::{Mutex, OnceLock};
@@ -579,6 +582,8 @@ async fn config_agent_tools_and_threads_mutation_paths_round_trip() {
async fn target_domain_read_paths_round_trip_through_json_rpc_transport() {
let _lock = env_lock();
let harness = setup().await;
+ // The memory_* reads below reach the driver; wait out the module's load.
+ memory_module::settle().await;
let calls = [
("openhuman.config_get_client_config", json!({})),
diff --git a/tests/json_rpc_e2e.rs b/tests/json_rpc_e2e.rs
index 4ce8c8d489..9ccd2a574d 100644
--- a/tests/json_rpc_e2e.rs
+++ b/tests/json_rpc_e2e.rs
@@ -3,6 +3,9 @@
//! Isolates config under a temp `HOME` so auth profiles and the OpenHuman provider resolve
//! the same state directory. Run with: `cargo test --test json_rpc_e2e`
+#[path = "support/memory_module.rs"]
+mod memory_module;
+
use std::collections::VecDeque;
use std::net::SocketAddr;
use std::path::{Path, PathBuf};
@@ -12019,6 +12022,8 @@ async fn json_rpc_memory_sources_reconcile_reports_pending_raw_files() {
EnvVarGuard::set_to_path("OPENHUMAN_WORKSPACE", json_rpc_e2e_shared_workspace());
let _action_guard = EnvVarGuard::set_to_path("OPENHUMAN_ACTION_DIR", home);
let _backend_guard = EnvVarGuard::unset("VITE_BACKEND_URL");
+ // reconcile reads the module's store; wait out the module's load first.
+ memory_module::settle().await;
let (rpc_addr, rpc_join) = serve_on_ephemeral(build_core_http_router(false)).await;
let rpc_base = format!("http://{rpc_addr}");