Make test a bit more robust

This commit is contained in:
Kovid Goyal 2022-07-17 21:54:06 +05:30
parent 96656a1f2d
commit 8660e20976
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -845,7 +845,14 @@ class WritingTest(BaseTest):
def ae(l, r): def ae(l, r):
# We need to sleep a bit to allow events to happen on its thread # We need to sleep a bit to allow events to happen on its thread
import time import time
time.sleep(.001) st = time.monotonic()
while time.monotonic() - st < 1:
time.sleep(0.01)
try:
self.assertEqual(l, r)
return
except Exception:
pass
self.assertEqual(l, r) self.assertEqual(l, r)
cache = self.init_cache(self.cloned_library) cache = self.init_cache(self.cloned_library)