Исправить замечания перепроверки: непредусмотренные ошибки worker, pull_policy, тест окна D

This commit is contained in:
2026-11-13 16:42:44 +03:00
parent 13bec4ab8b
commit 3ebd674062
4 changed files with 46 additions and 8 deletions
+14
View File
@@ -11,6 +11,7 @@
crash-after-s3-put все объекты записаны в S3, COMMIT ready не сделан, ack не отправлен
crash-after-commit ready зафиксирован, ack не отправлен (и staging не удалён)
transient-2 временная ошибка в попытках 1–2: backoff с jitter, ready с 3-й
bug непредусмотренное исключение в 1-й попытке -> processing_failed -> retry -> ready
transient-always временная ошибка до replay: 5 попыток -> failed(retry_exhausted)
-> content 409, прикрепление 409 -> ops replay -> ready; повторный replay отклонён
staging tamper staging подменён до обработки -> failed(staging_corrupted) без повторов
@@ -20,6 +21,7 @@
import argparse
import json
import subprocess
import time
from lab5lib import (Client, Log, SAMPLE_PNG, check, compose, events, get_att, invariants, ops, png, queues,
recreate, upload, wait_status, wait_until)
@@ -77,6 +79,18 @@ def main():
"invariants": inv}
log.step("transient-2: retried with backoff", delays=delays, bounds=bounds, invariants=inv)
# --- непредусмотренное исключение: штатный retry, а не «висящий» processing ----------
att = upload(c, alice, chat, SAMPLE_PNG, "fault-bug.png")
t0 = time.monotonic()
ready = wait_status(c, bob, att["id"], {"ready", "failed"}, timeout=60)
took = round(time.monotonic() - t0, 2)
info = ops("inspect", att["id"])
codes = [e["detail"]["error_code"] for e in info["events"] if e["event"] == "retry_scheduled"]
check(ready["status"] == "ready" and codes == ["processing_failed"] and took < 15, "bug: retry path")
report["bug"] = {"attachment_id": att["id"], "retry_error_codes": codes, "seconds_to_ready": took,
"events": events(info), "invariants": invariants(info)}
log.step("unexpected exception -> processing_failed -> retry -> ready", **report["bug"])
# --- исчерпание попыток -> failed -> replay ----------------------------------------
att = upload(c, alice, chat, SAMPLE_PNG, "fault-transient-always.png")
failed = wait_status(c, bob, att["id"], {"ready", "failed"}, timeout=120)