feat: limit accepted attachment work and add queue overload bench

Reject uploads with 429 at [uploads] max_unfinished_jobs, counted by the existing partial indexes in the membership block. Add the bench_queue profile, hypotheses H1-H9 and the fifth failure-stand API.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-01 07:30:08 +03:00
co-authored by Claude Opus 5.5
parent 5b5f59aa3b
commit d667fa3c57
53 changed files with 5043 additions and 122 deletions
+16
View File
@@ -26,6 +26,10 @@ FAULT_UPLOADS_BASE_URL = os.environ.get("FAULT_UPLOADS_BASE_URL", "").rstrip(
)
# API стенда отказов с коротким сроком вызова S3 (change fix-upload-put-flake)
FAULT_S3_BASE_URL = os.environ.get("FAULT_S3_BASE_URL", "").rstrip("/")
# «узкий по заданиям» API стенда отказов (change track1-queue-overload)
FAULT_BACKLOG_BASE_URL = os.environ.get("FAULT_BACKLOG_BASE_URL", "").rstrip(
"/",
)
FAULT_HOOK_TIMEOUT_S = 120
# срок клиента «узкого» API: больше ожидания места, срока тела и шагов
UPLOADS_CLIENT_TIMEOUT_S = 30
@@ -69,6 +73,7 @@ def pytest_collection_finish(session: pytest.Session) -> None:
and FAULT_TIGHT_BASE_URL
and FAULT_UPLOADS_BASE_URL
and FAULT_S3_BASE_URL
and FAULT_BACKLOG_BASE_URL
):
pytest.exit(
"fault checks need the failure stand and its hook: "
@@ -199,3 +204,14 @@ def s3_api() -> Iterator[Api]:
"""API стенда отказов со сроком вызова S3 1 с (`FAULT_S3_ENV`)."""
with Api(FAULT_S3_BASE_URL, timeout=S3_CLIENT_TIMEOUT_S) as client:
yield client
@pytest.fixture(scope="session")
def backlog_api() -> Iterator[Api]:
"""API стенда отказов с малым пределом незавершённых заданий
(`FAULT_BACKLOG_ENV`)."""
with Api(
FAULT_BACKLOG_BASE_URL,
timeout=UPLOADS_CLIENT_TIMEOUT_S,
) as client:
yield client