timing sync
authorVolker Birk <vb@pep-project.org>
Sat, 20 Apr 2019 17:35:08 +0200
branchsync
changeset 27293ef9c7e012d
parent 271 760aaa8e796b
child 273 37696cf19002
timing
test/minimail.py
     1.1 --- a/test/minimail.py	Wed Apr 17 22:36:29 2019 +0200
     1.2 +++ b/test/minimail.py	Sat Apr 20 17:35:08 2019 +0200
     1.3 @@ -24,6 +24,9 @@
     1.4  from time import sleep
     1.5  
     1.6  
     1.7 +timing = .3
     1.8 +
     1.9 +
    1.10  def unlock(inbox):
    1.11      "clear the inbox from lockfile"
    1.12  
    1.13 @@ -46,14 +49,14 @@
    1.14      def __enter__(self):
    1.15          lockfile = self.inbox / "lock"
    1.16          while lockfile.is_file():
    1.17 -            sleep(1)
    1.18 +            sleep(timing)
    1.19          lockfile.touch()
    1.20  
    1.21  
    1.22  def send(inbox, msg, marker):
    1.23      "send msg to inbox in MIME format"
    1.24  
    1.25 -    sleep(1)
    1.26 +    sleep(timing)
    1.27      with Lock(inbox):
    1.28          name = marker + "_" + token_urlsafe(16) + ".eml"
    1.29          with open(inbox / name, "wb") as f:
    1.30 @@ -94,7 +97,7 @@
    1.31                  os.utime(str(inbox / marker), (newest, newest))
    1.32  
    1.33          if not r:
    1.34 -            sleep(1)
    1.35 +            sleep(timing)
    1.36  
    1.37      return r
    1.38