test: Bound broker queue observation in confirm-gap probe
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user