tests: fifo_dlq_probe — опрос DLQ до 10с вместо мгновенной проверки (гонка с тиком); финальная регрессия зелёная
This commit is contained in:
@@ -89,7 +89,15 @@ def check_dlq():
|
|||||||
b = sqs.receive_message(QueueUrl=main_url, MaxNumberOfMessages=1).get("Messages", [])
|
b = sqs.receive_message(QueueUrl=main_url, MaxNumberOfMessages=1).get("Messages", [])
|
||||||
print("attempt %d: %s" % (attempt + 1, "received" if b else "empty"), flush=True)
|
print("attempt %d: %s" % (attempt + 1, "received" if b else "empty"), flush=True)
|
||||||
time.sleep(1.5)
|
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"
|
ok = len(dlq_msgs) == 1 and dlq_msgs[0]["Body"] == "to-dlq"
|
||||||
results["dlq"] = ok
|
results["dlq"] = ok
|
||||||
print("dlq: count=%d body=%s %s" % (len(dlq_msgs), dlq_msgs[0]["Body"] if dlq_msgs else None,
|
print("dlq: count=%d body=%s %s" % (len(dlq_msgs), dlq_msgs[0]["Body"] if dlq_msgs else None,
|
||||||
|
|||||||
Reference in New Issue
Block a user