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
@@ -77,9 +77,9 @@ class RCRestClient:
req = urllib.request.Request(url, data=body, headers=headers, method=method)
# 429 retry with exponential backoff: 3s → 6s → 12s → 20s → 30s (max 5 retries)
# Total possible wait: 71s — gives RC enough time to reset its rate-limit window.
_429_BACKOFFS = [3.0, 6.0, 12.0, 20.0, 30.0]
# 429 retry with exponential backoff: 5s → 10s → 20s → 40s (max 4 retries)
# Total possible wait: 75s — gives RC enough time to reset its rate-limit window.
_429_BACKOFFS = [5.0, 10.0, 20.0, 40.0]
max_429_retries = len(_429_BACKOFFS)
for attempt in range(max_429_retries + 1):
# Rate-limit before every API call (protects post, history, delete, etc.)