New submission from STINNER Victor <[email protected]>:
The commit cbe72d842646ded2454784679231e3d1e6252e72 is a good example:
deadline = time.monotonic() + 60
t = 0.1
while time.monotonic() < deadline:
time.sleep(t)
t = min(t*2, 5)
try:
smm = shared_memory.SharedMemory(name, create=False)
except FileNotFoundError:
break
else:
raise AssertionError("A SharedMemory segment was leaked after"
" a process was abruptly terminated.")
It would be nice to convert this code pattern into an helper function in
test.support. It's common to have to wait for something in tests.
----------
components: Tests
messages: 342751
nosy: vstinner
priority: normal
severity: normal
status: open
title: test.support: add an helper to wait for an event with a timeout
versions: Python 3.7, Python 3.8
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue36950>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com