Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ jobs:
# Currently failing.
--ignore=src/tests/api_gateway/test_app_startup_catalog.py
--ignore=src/tests/api_gateway/test_config_modes.py
--ignore=src/tests/api_gateway/test_oauth_router.py
--ignore=src/tests/api_gateway/test_oidc_role_mapping.py
--ignore=src/tests/api_gateway/test_rate_limiter_ttl.py
--ignore=src/tests/cli/test_dashboard_config.py
--ignore=src/tests/common/test_cli_providers.py
--ignore=src/tests/common/test_cluster_naming.py
Expand Down
2 changes: 1 addition & 1 deletion src/tests/api_gateway/test_oauth_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from httpx import ASGITransport, AsyncClient


def _build_app(monkeypatch, *, auth_provider="external", base="https://auth.example.test",
def _build_app(monkeypatch, *, auth_provider="oidc", base="https://auth.example.test",
redirect_uri="https://app.example.test/auth/callback",
client_id="inferiallm-dashboard") -> FastAPI:
"""Wire the oauth_router into a clean FastAPI app with patched settings."""
Expand Down
8 changes: 7 additions & 1 deletion src/tests/api_gateway/test_rate_limiter_ttl.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,15 @@ async def test_is_allowed_creates_bucket(self):
@pytest.mark.asyncio
async def test_rate_limit_exhaustion(self):
limiter = InMemoryRateLimiter()
# Exhaust all tokens
# The defaults refill 166 tokens a second, which is faster than the
# loop below drains 1000 of them, so the bucket never empties. Both
# are set here to measure exhaustion rather than loop speed.
limiter.burst_size = 5
limiter.requests_per_minute = 0

for _ in range(limiter.burst_size):
allowed, _ = await limiter.is_allowed("user:exhaust")
assert allowed is True
# Next request should be denied
allowed, metadata = await limiter.is_allowed("user:exhaust")
assert allowed is False
Expand Down
Loading