Commit 3897122e authored by kaiyou's avatar kaiyou
Browse files

Remove a debug print

parent 3a332a74
Pipeline #210 passed with stage
in 1 minute and 4 seconds
......@@ -19,25 +19,26 @@ def send_then_receive(send_function, lookup_function):
def decorator(original_check):
def actual_check(context, account_from, account_to,
dest=None, timeout=120.0):
dest=None, timeout=120.0,
message="{}", expected="{}"):
if dest is None:
dest = account_to["username"]
# Generate, store and send a canary
canary = os.urandom(8).hex()
result = {"canary": canary, **context}
send_function(result, account_from, dest, canary)
send_function(result, account_from, dest, message.format(canary))
# Wait for the canary to be received or timeout
start_time = time.time()
delay = 0
found = False
while delay < timeout and not found:
found = lookup_function(result, account_to, dest, canary)
found = lookup_function(result, account_to, dest,
delay = int(time.time() - start_time)
result["up"] = found
result["message"] = f"message delivered in {delay} seconds" \
if found else f"message not delivered"
return result
actual_check.__name__ = original_check.__name__
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment