tests: fifo_dlq_probe — опрос DLQ до 10с вместо мгновенной проверки (гонка с тиком); финальная регрессия зелёная

This commit is contained in:
“Naeel”
2026-08-15 09:31:11 +04:00
parent 22d3ea3d40
commit 6a292769a3
2 changed files with 26 additions and 1 deletions
+9 -1
View File
@@ -89,7 +89,15 @@ def check_dlq():
b = sqs.receive_message(QueueUrl=main_url, MaxNumberOfMessages=1).get("Messages", [])
print("attempt %d: %s" % (attempt + 1, "received" if b else "empty"), flush=True)
time.sleep(1.5)
dlq_msgs = drain(dlq_url)
# Перенос в DLQ выполняет фоновый тик PeriodicTasks (период 1с) при
# истечении VisibilityTimeout. Мгновенная проверка гоняет с фазой тика —
# опрашиваем DLQ до 10с.
dlq_msgs = []
for _ in range(10):
dlq_msgs = drain(dlq_url)
if dlq_msgs:
break
time.sleep(1)
ok = len(dlq_msgs) == 1 and dlq_msgs[0]["Body"] == "to-dlq"
results["dlq"] = ok
print("dlq: count=%d body=%s %s" % (len(dlq_msgs), dlq_msgs[0]["Body"] if dlq_msgs else None,