Skip to content

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

test: stabilize process source and memory status coverage

Steven Enamakelf8a980446d9b
diff --git a/app/src/features/conversations/Conversations.processSourceCommand.test.tsx b/app/src/features/conversations/Conversations.processSourceCommand.test.tsx
index ce02553d89..5a9d6f0996 100644
--- a/app/src/features/conversations/Conversations.processSourceCommand.test.tsx
+++ b/app/src/features/conversations/Conversations.processSourceCommand.test.tsx
@@ -25,6 +25,7 @@ import threadGoalReducer from '../../store/threadGoalSlice';
import threadReducer from '../../store/threadSlice';
import threadTodosReducer from '../../store/threadTodosSlice';
import type { Thread } from '../../types/thread';
+import Conversations from './Conversations';
const { mockGetThreads, mockGetThreadMessages, mockUseUsageState } = vi.hoisted(() => ({
mockGetThreads: vi.fn().mockResolvedValue({ threads: [], count: 0 }),
@@ -159,8 +160,6 @@ async function renderChat(composer?: 'text' | 'mic-cloud', withProcessData = fal
}
: {}),
});
- const { default: Conversations } = await import('./Conversations');
-
await act(async () => {
render(
<Provider store={store}>
diff --git a/tests/json_rpc_e2e.rs b/tests/json_rpc_e2e.rs
index aafb21f023..891d90d11a 100644
--- a/tests/json_rpc_e2e.rs
+++ b/tests/json_rpc_e2e.rs
@@ -4021,14 +4021,27 @@ async fn json_rpc_memory_sync_and_learn() {
);
// ── memory_ingestion_status: idle after direct learning ─────────────────
- let ing_status = post_json_rpc(
- &rpc_base,
- 7006,
- "openhuman.memory_ingestion_status",
- json!({}),
- )
- .await;
- let ing_result = assert_no_jsonrpc_error(&ing_status, "memory_ingestion_status");
+ // The module's worker may still be settling an item that was already in
+ // flight when the shared store was wiped. Poll the read-only status until
+ // the worker releases it instead of racing its last queue-stat update.
+ let ing_result = tokio::time::timeout(Duration::from_secs(10), async {
+ loop {
+ let ing_status = post_json_rpc(
+ &rpc_base,
+ 7006,
+ "openhuman.memory_ingestion_status",
+ json!({}),
+ )
+ .await;
+ let result = assert_no_jsonrpc_error(&ing_status, "memory_ingestion_status");
+ if result.get("running") == Some(&json!(false)) {
+ break result.clone();
+ }
+ tokio::time::sleep(Duration::from_millis(100)).await;
+ }
+ })
+ .await
+ .expect("memory ingestion did not settle after clearing the fresh store");
assert_eq!(
ing_result.get("running"),
Some(&json!(false)),