Compare commits

..

No commits in common. "89b14872e665fee598a824d42a3178c512e2a93d" and "b2f8eaf89ab9975403f6147810b42370fe2dd0a7" have entirely different histories.

2 changed files with 0 additions and 19 deletions

View File

@ -43,8 +43,6 @@ async def readiness():
user = await asyncio.wait_for( user = await asyncio.wait_for(
current_user(), timeout=READINESS_TIMEOUT_SECONDS current_user(), timeout=READINESS_TIMEOUT_SECONDS
) )
if not isinstance(user, dict) or not user.get("login"):
raise ValueError("Gitea current-user response did not include a login")
except Exception as exc: except Exception as exc:
timed_out = isinstance(exc, TimeoutError) timed_out = isinstance(exc, TimeoutError)
error_message = ( error_message = (

View File

@ -42,23 +42,6 @@ async def test_readiness_endpoint_returns_503_when_gitea_is_unavailable(monkeypa
assert b'"error":"connection refused"' in response.body assert b'"error":"connection refused"' in response.body
@pytest.mark.anyio
async def test_readiness_endpoint_returns_503_for_null_current_user_payload(monkeypatch):
async def null_user():
return None
monkeypatch.setattr(main, "current_user", null_user)
response = await main.readiness()
assert response.status_code == 503
assert json.loads(response.body) == {
"status": "not_ready",
"service": "stackchain-dashboard",
"error": "Gitea current-user response did not include a login",
}
@pytest.mark.anyio @pytest.mark.anyio
async def test_readiness_endpoint_times_out_and_cancels_stalled_gitea_check(monkeypatch): async def test_readiness_endpoint_times_out_and_cancels_stalled_gitea_check(monkeypatch):
cancelled = asyncio.Event() cancelled = asyncio.Event()