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:
@@ -0,0 +1,24 @@
|
||||
def _get_app_attr(app: Any, name: str, default: Any = None) -> Any:
|
||||
"""Retrieves an attribute from the App or its Controller."""
|
||||
if hasattr(app, name):
|
||||
val = getattr(app, name)
|
||||
return val
|
||||
if hasattr(app, 'controller') and hasattr(app.controller, name):
|
||||
val = getattr(app.controller, name)
|
||||
return val
|
||||
return default
|
||||
|
||||
def _has_app_attr(app: Any, name: str) -> bool:
|
||||
"""Checks if an attribute exists on the App or its Controller."""
|
||||
if hasattr(app, name): return True
|
||||
if hasattr(app, 'controller') and hasattr(app.controller, name): return True
|
||||
return False
|
||||
|
||||
def _set_app_attr(app: Any, name: str, value: Any) -> None:
|
||||
"""Sets an attribute on the App or its Controller."""
|
||||
if hasattr(app, name):
|
||||
setattr(app, name, value)
|
||||
elif hasattr(app, 'controller'):
|
||||
setattr(app.controller, name, value)
|
||||
else:
|
||||
setattr(app, name, value)
|
||||
Reference in New Issue
Block a user