forked from mtusi2026/mtusi2026lab5
feat(lab5): durable async attachment pipeline through grade 4
- RabbitMQ quorum queue, persistent messages and publisher confirms - S3 staging plus PostgreSQL attachments/jobs outbox transaction - worker variants (thumbnail, crop, optimized WebP), DB lease and lease sweeper - jittered retry, permanent failures, explicit replay and admission cap - deterministic crash hooks, resilience script and evidence for grade 4 - async-aware custom tests, oversized pixel case, docs and changelog
This commit is contained in:
@@ -72,7 +72,7 @@ def main():
|
||||
response = client.call(
|
||||
"POST",
|
||||
f"/api/v1/chats/{chat['id']}/attachments?filename=concurrent-{index}.png",
|
||||
201,
|
||||
202,
|
||||
actor=alice,
|
||||
raw=png,
|
||||
headers={"Content-Type": "image/png"},
|
||||
@@ -102,8 +102,11 @@ def main():
|
||||
instances = sorted({item["instance"] for item in results if item["instance"]})
|
||||
check(bool(instances), "no X-Instance-Id was observed")
|
||||
|
||||
# Read one uploaded object back and compare the exact bytes before reporting
|
||||
# success; ten 201 responses alone are not enough.
|
||||
# Lab5: a 202 only means the intent is durable. Wait for the worker, then
|
||||
# read one object back and compare the exact bytes; accepted responses
|
||||
# alone are not enough.
|
||||
for item in results:
|
||||
c.wait_ready(alice, item, wait_seconds=120)
|
||||
download = c.call(
|
||||
"GET", f"/api/v1/attachments/{results[0]['id']}/content", actor=alice
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user