Implement Graceful Degradation Test Scenarios #919

Closed
opened 2026-03-22 14:15:41 +00:00 by antigravity · 1 comment
Collaborator

The system mandates graceful degradation when Ollama, Redis, or AirLLM go down, but these paths are severely under-tested. Create test cases specifically for simulating service failures and assessing the fallback logic.

The system mandates graceful degradation when Ollama, Redis, or AirLLM go down, but these paths are severely under-tested. Create test cases specifically for simulating service failures and assessing the fallback logic.
claude was assigned by Rockachopa 2026-03-22 23:31:45 +00:00
Collaborator

PR created: http://143.198.27.163:3000/Rockachopa/Timmy-time-dashboard/pulls/1291

Added tests/infrastructure/test_graceful_degradation.py with 35 test cases covering all the under-tested fallback paths:

  • Ollama health-check failures (connection refused, timeout, HTTP 503/500, generic exception) → provider excluded from cascade
  • requests library absent → Ollama and vllm-mlx optimistically assume availability
  • Cascade failover: Ollama connection error → Anthropic cloud fallback used
  • Circuit-breaker full lifecycle: CLOSED → OPEN (N failures) → HALF_OPEN (timeout elapsed) → CLOSED (test successes), plus HALF_OPEN failure re-opens
  • All providers fail → RuntimeError lists individual errors
  • ClaudeBackend/GrokBackend graceful degradation: no-key and API-error paths
  • Chat store SQLite resilience: directory auto-creation, concurrent writes (thread-safe), ordering, recent(), pruning

All 505 unit tests pass.

PR created: http://143.198.27.163:3000/Rockachopa/Timmy-time-dashboard/pulls/1291 Added `tests/infrastructure/test_graceful_degradation.py` with 35 test cases covering all the under-tested fallback paths: - **Ollama health-check failures** (connection refused, timeout, HTTP 503/500, generic exception) → provider excluded from cascade - **`requests` library absent** → Ollama and vllm-mlx optimistically assume availability - **Cascade failover**: Ollama connection error → Anthropic cloud fallback used - **Circuit-breaker full lifecycle**: CLOSED → OPEN (N failures) → HALF_OPEN (timeout elapsed) → CLOSED (test successes), plus HALF_OPEN failure re-opens - **All providers fail** → RuntimeError lists individual errors - **ClaudeBackend/GrokBackend** graceful degradation: no-key and API-error paths - **Chat store SQLite resilience**: directory auto-creation, concurrent writes (thread-safe), ordering, recent(), pruning All 505 unit tests pass.
Sign in to join this conversation.
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#919