|
| 1 | +@e2e_group_3 @skip-in-library-mode @Authorized |
| 2 | +Feature: Degraded mode startup |
| 3 | + |
| 4 | + End-to-end scenarios that test LCORE startup behavior when llama-stack |
| 5 | + is NOT available at startup time and allow_degraded_mode is enabled. |
| 6 | + |
| 7 | + These tests verify that LCORE can start without llama-stack and continue |
| 8 | + to serve health/metrics endpoints in degraded mode. |
| 9 | + |
| 10 | + Background: |
| 11 | + Given The service is started locally |
| 12 | + And The system is in default state |
| 13 | + And REST API service prefix is /v1 |
| 14 | + And the Lightspeed stack configuration directory is "tests/e2e/configuration" |
| 15 | + |
| 16 | + @skip-health-check |
| 17 | + Scenario: Service starts in degraded mode when llama-stack is not running |
| 18 | + Given The llama-stack connection is disrupted |
| 19 | + And The service uses the lightspeed-stack-degraded-mode.yaml configuration |
| 20 | + And The service is restarted |
| 21 | + When I access endpoint "liveness" using HTTP GET method |
| 22 | + Then The status code of the response is 200 |
| 23 | + And The body of the response is the following |
| 24 | + """ |
| 25 | + {"alive": true} |
| 26 | + """ |
| 27 | + |
| 28 | + @skip-health-check |
| 29 | + Scenario: Readiness endpoint reports degraded state when started without llama-stack |
| 30 | + Given The llama-stack connection is disrupted |
| 31 | + And The service uses the lightspeed-stack-degraded-mode.yaml configuration |
| 32 | + And The service is restarted |
| 33 | + When I access endpoint "readiness" using HTTP GET method |
| 34 | + Then The status code of the response is 503 |
| 35 | + And The body of the response, ignoring the "providers" field, is the following |
| 36 | + """ |
| 37 | + {"ready": false, "reason": "Cannot connect to backend service", "overall_status": "unhealthy", "impacts": ["LLM inference unavailable", "Provider health checks unavailable"]} |
| 38 | + """ |
| 39 | + |
| 40 | + @skip-health-check |
| 41 | + Scenario: Metrics endpoint works in degraded mode |
| 42 | + Given The llama-stack connection is disrupted |
| 43 | + And The service uses the lightspeed-stack-degraded-mode.yaml configuration |
| 44 | + And The service is restarted |
| 45 | + When I access endpoint "metrics" using HTTP GET method |
| 46 | + Then The status code of the response is 200 |
| 47 | + And The response body contains "ls_started_in_degraded_mode" |
| 48 | + |
| 49 | + @skip-health-check |
| 50 | + Scenario: Degraded mode metric is set to 1.0 when started without llama-stack |
| 51 | + Given The llama-stack connection is disrupted |
| 52 | + And The service uses the lightspeed-stack-degraded-mode.yaml configuration |
| 53 | + And The service is restarted |
| 54 | + When I access endpoint "metrics" using HTTP GET method |
| 55 | + Then The status code of the response is 200 |
| 56 | + And The response body contains "ls_started_in_degraded_mode 1.0" |
| 57 | + |
| 58 | + @skip @manual |
| 59 | + Scenario: Degraded mode metric is set to 0.0 when started with llama-stack |
| 60 | + # This scenario requires llama-stack Docker container to be running |
| 61 | + # Skip for local development, runs in CI only |
| 62 | + Given Llama Stack is restarted |
| 63 | + And The service uses the lightspeed-stack-degraded-mode.yaml configuration |
| 64 | + And The service is restarted |
| 65 | + When I access endpoint "metrics" using HTTP GET method |
| 66 | + Then The status code of the response is 200 |
| 67 | + And The response body contains "ls_started_in_degraded_mode 0.0" |
0 commit comments