From aeb43500a74a1b7540da6b0a586eb6ca5f0cbf22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=AA=20Faleiros?= Date: Mon, 30 Nov 2026 11:32:26 -0300 Subject: [PATCH] test: the pending-upload burst waits for the gateway's bucket to refill (CI run 393) nginx allows 20 r/s with a burst of 100; after the upload starts before it, a fast runner met nginx's 429 instead of the API's Retry-After 15. Co-Authored-By: Claude Opus 5.5 --- tests/upload_limits_test.py | 5 +++++ 1 file changed, 5 insertions(+) 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'])