тесты: ждать обновления счётчиков rabbitmqctl; collect_evidence и CI для lab5

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alexey Bodanyuk
2026-10-31 17:02:24 +03:00
co-authored by Claude Opus 5.5
parent 962adbe03b
commit a3fa7713fa
4 changed files with 46 additions and 22 deletions
+3 -2
View File
@@ -144,11 +144,12 @@ def test_worker_stopped_upload_202_content_409_restart_api_and_broker_then_ready
api.send(bob, chat, "текст работает без worker")
msg = api.post_message(alice, chat, {"text": "фото", "attachment_ids": [att["id"]]}).json()
wait_for(lambda: all(o["published"] for o in outbox_of(att["id"])), 15, "relay did not publish the job")
assert queue_depth() >= 1 # durable message waits in the queue
# rabbitmqctl counters are refreshed every ~5 s (statistics interval): wait, do not sample once.
wait_for(lambda: queue_depth() >= 1, 20, "no message in the queue") # durable message waits in the queue
compose("restart", "api", "broker") # volumes preserved
wait_healthy("api", "broker", "relay")
wait_stand()
assert queue_depth() >= 1, "the accepted job was lost by the broker restart"
wait_for(lambda: queue_depth() >= 1, 20, "the accepted job was lost by the broker restart")
assert api.attachment(bob, att["id"])["status"] == "queued"
finally:
compose("start", "worker")