diff --git a/tests/upload_limits_test.py b/tests/upload_limits_test.py index 795c6f2..55f25b8 100644 --- a/tests/upload_limits_test.py +++ b/tests/upload_limits_test.py @@ -7,6 +7,7 @@ Run against the local stack: python -m tests.upload_limits_test import json import os import secrets +import time from pathlib import Path from urllib.error import HTTPError from urllib.request import Request @@ -68,6 +69,10 @@ def run(): # DTF-WEB-3: a burst above MAX_PENDING_UPLOADS (now 30). The 31st start # answers 429 with Retry-After 15, so the Site waits and retries alone. assert int(os.environ.get('MAX_PENDING_UPLOADS', '30')) == 30 + # The gateway allows 20 requests a second with a burst of 100 + # (infra/nginx.conf.template): after the starts above, a fast runner + # meets nginx's 429 before the API's (CI run 393). Let it refill. + time.sleep(6) pending = [] for index in range(30): pending.append(client.call('/uploads', {'name': f'PENDING-{index}.png', 'size': 1})['id'])