тесты lab4 переведены на 202 + worker; unit-тесты pipeline; кейсы рецензий как 415

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

PNG с фильтром строки 5/0xff, IDAT не zlib, JPEG из 27 байт, SOS с компонентом не из SOF:
415 при загрузке. 40 Мпикс проходит до ready в лимите памяти worker.
This commit is contained in:
Alexey Bodanyuk
2026-10-31 16:12:52 +03:00
parent bc32a50967
commit aef6eb1d4c
8 changed files with 449 additions and 91 deletions
+6 -1
View File
@@ -1,4 +1,5 @@
"""S3 outages, private bucket and failover of attachments (lab 4, levels 3 and 4).
"""S3 outages, private buckets and failover of attachments (lab 4, levels 3 and 4; lab 5: two
buckets, upload 202 + worker).
Every injected failure is undone in `finally` (conftest.service_down / replica_stopped), and the
stand is waited for until HAProxy sees all replicas UP again."""
@@ -33,6 +34,7 @@ def test_s3_outage_is_503_and_text_keeps_working(api, pair, how):
* after recovery the earlier file is intact."""
alice, bob, chat = pair
att = api.upload(alice, chat, SAMPLE).json()
api.wait_status(alice, att["id"], "ready")
with service_down("s3", how):
deadline = time.monotonic() + 15
while api.client.get("/health/ready").status_code != 503:
@@ -63,6 +65,7 @@ def test_upload_survives_failover_of_the_serving_replica(api, pair):
response = api.upload(alice, chat, data)
att, served_by = response.json(), response.headers["x-instance-id"]
replica = next(r for r in running_replicas() if r["hostname"] == served_by)
api.wait_status(bob, att["id"], "ready")
with replica_stopped(replica, "kill"):
for _ in range(5):
got = api.call("GET", f"/api/v1/attachments/{att['id']}/content", 200, token=bob["token"])
@@ -75,6 +78,7 @@ def test_bucket_is_private_outside_the_api(api, pair):
SeaweedFS admin endpoints (master 9333, filer 8888, volume 8080) are not reachable."""
alice, _, chat = pair
att = api.upload(alice, chat, SAMPLE).json()
api.wait_status(alice, att["id"], "ready")
key = attachment_row(att["id"])["object_key"]
probe = (
"import urllib.request as u, urllib.error as e, socket\n"
@@ -102,6 +106,7 @@ def test_s3_restart_keeps_objects(api, pair):
alice, bob, chat = pair
data = imagegen.png_of_size(200_000)
att = api.upload(alice, chat, data).json()
api.wait_status(bob, att["id"], "ready")
with service_down("s3", "stop"):
pass
assert api.call("GET", f"/api/v1/attachments/{att['id']}/content", 200, token=bob["token"]).content == data