Private
Public Access
0
0

fix(test): Final synchronization and stability fixes for RAG stress test

- Improved AppController.ai_status to prevent overwriting 'sending...' with 'models loaded'.
- Enhanced 	est_rag_phase4_stress.py with robust polling and increased timeout.
- Synchronized App and AppController history objects to ensure consistent view.
This commit is contained in:
2026-05-16 01:21:27 -04:00
parent 7f2f9c1989
commit 20054b0476
16 changed files with 296 additions and 716 deletions
+8 -4
View File
@@ -54,10 +54,11 @@ def test_user_request_integration_flow(mock_app: App) -> None:
# 3. Verify ai_client.send was called
assert mock_send.called, "ai_client.send was not called"
# 4. Now the 'response' event is in app.controller.event_queue
# But NO ONE is consuming it because _process_event_queue is in the mocked start_services thread.
# Let's manually run one tick of the event queue processing logic
# In _process_event_queue: event_name, payload = self.event_queue.get()
# 4. First event should be 'comms' (request logging)
event_name, payload = app.controller.event_queue.get()
assert event_name == "comms"
# 5. Next event should be 'response'
event_name, payload = app.controller.event_queue.get()
assert event_name == "response"
@@ -102,6 +103,9 @@ def test_user_request_error_handling(mock_app: App) -> None:
app.controller._handle_request_event(event)
# Manually consume from queue
event_name, payload = app.controller.event_queue.get()
assert event_name == "comms"
event_name, payload = app.controller.event_queue.get()
assert event_name == "response"
assert payload["status"] == "error"