test: Bound broker queue observation in confirm-gap probe

This commit is contained in:
Самохвалов Андрей Ремович
2026-10-02 15:25:13 +03:00
parent e5d8796dc6
commit 9fac497d1a
2 changed files with 8 additions and 2 deletions
+7 -1
View File
@@ -2,6 +2,7 @@
import json
import os
import time
from pathlib import Path
from uuid import UUID, uuid4
@@ -52,7 +53,12 @@ try:
"SELECT published_at IS NOT NULL AS confirmed FROM attachment_outbox "
"WHERE id=%s", (row["id"],),
).fetchone()
count = channel.queue_declare(queue=QUEUE, passive=True).method.message_count
deadline = time.monotonic() + 3
while True:
count = channel.queue_declare(queue=QUEUE, passive=True).method.message_count
if count >= 2 or time.monotonic() >= deadline:
break
time.sleep(0.05)
assert published >= 1 and outbox["confirmed"] and count >= 2
print(json.dumps({"confirmed_after_republish": True, "queued_copies_before_worker": count}))
finally:
+1 -1
View File
@@ -13,7 +13,7 @@ from client import Client, arguments, check, run # noqa: E402
def compose(*args, input_data=None):
return subprocess.run(
["docker", "compose", *args], cwd=ROOT,
["docker", "compose", "-f", "compose.yaml", "-f", "compose.telemetry.yaml", *args], cwd=ROOT,
input=input_data, check=True,
)