[issue36950] test.support: add an helper to wait for an event with a timeout

2021-05-26 Thread STINNER Victor
STINNER Victor added the comment: I close the issue because of the lack of activity. The need for this function is not very clear at this point. -- resolution: -> out of date stage: patch review -> resolved status: open -> closed ___ Python tracke

[issue36950] test.support: add an helper to wait for an event with a timeout

2019-05-18 Thread Pierre Glaser
Pierre Glaser added the comment: Just did so. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue36950] test.support: add an helper to wait for an event with a timeout

2019-05-18 Thread Pierre Glaser
Change by Pierre Glaser : -- keywords: +patch pull_requests: +13318 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-l

[issue36950] test.support: add an helper to wait for an event with a timeout

2019-05-18 Thread STINNER Victor
STINNER Victor added the comment: Would you be interested to propose a PR? Maybe raise an assertion error by default, but allow to customize it in the API? -- ___ Python tracker _

[issue36950] test.support: add an helper to wait for an event with a timeout

2019-05-18 Thread Pierre Glaser
Pierre Glaser added the comment: Lib/test/test_asyncio/utils.py defines a similar helper: def run_until(loop, pred, timeout=30): deadline = time.monotonic() + timeout while not pred(): if timeout is not None: timeout = deadline - time.monotonic() if time

[issue36950] test.support: add an helper to wait for an event with a timeout

2019-05-18 Thread Pierre Glaser
Change by Pierre Glaser : -- nosy: +pierreglaser ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue36950] test.support: add an helper to wait for an event with a timeout

2019-05-17 Thread STINNER Victor
New submission from STINNER Victor : 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)