tests: 429 rate-limiting fix — polling 5s/8s/12s/20s, 429-backoff 5s/10s/20s/40s, rate limiter 15 calls/min

This commit is contained in:
Bernd (Hermes)
2026-07-30 19:12:28 +02:00
parent 5c22391287
commit 6aaadcdb88
3 changed files with 16 additions and 16 deletions
+3 -3
View File
@@ -94,10 +94,10 @@ class RateLimiter:
"""Simple token-bucket rate limiter.
Allows max_tokens calls per window_seconds. Thread-safe via lock.
Default: 30 calls/minute (was 60 — RC triggers 429 at 3-4 calls in <10s).
Default: 15 calls/minute (was 30 — RC triggers 429 aggressively).
"""
def __init__(self, max_tokens: int = 30, window_seconds: float = 60.0):
def __init__(self, max_tokens: int = 15, window_seconds: float = 60.0):
self.max_tokens = max_tokens
self.window_seconds = window_seconds
self.tokens = float(max_tokens)
@@ -138,7 +138,7 @@ _rate_limiter: RateLimiter | None = None
def _get_rate_limiter() -> RateLimiter:
global _rate_limiter
if _rate_limiter is None:
_rate_limiter = RateLimiter(max_tokens=30, window_seconds=60.0)
_rate_limiter = RateLimiter(max_tokens=15, window_seconds=60.0)
return _rate_limiter