From 8d3ea9f8ab5284acd0683f891c0b778c490ef2bb Mon Sep 17 00:00:00 2001 From: Volker Birk Date: Sat, 20 Apr 2019 17:35:08 +0200 Subject: [PATCH] timing --- test/minimail.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/minimail.py b/test/minimail.py index 9733fd7..146b14e 100644 --- a/test/minimail.py +++ b/test/minimail.py @@ -24,6 +24,9 @@ from secrets import token_urlsafe from time import sleep +timing = .3 + + def unlock(inbox): "clear the inbox from lockfile" @@ -46,14 +49,14 @@ class Lock: def __enter__(self): lockfile = self.inbox / "lock" while lockfile.is_file(): - sleep(1) + sleep(timing) lockfile.touch() def send(inbox, msg, marker): "send msg to inbox in MIME format" - sleep(1) + sleep(timing) with Lock(inbox): name = marker + "_" + token_urlsafe(16) + ".eml" with open(inbox / name, "wb") as f: @@ -94,7 +97,7 @@ def recv_all(inbox, marker): os.utime(str(inbox / marker), (newest, newest)) if not r: - sleep(1) + sleep(timing) return r