消息 [342326]
I like Olivier's pattern. Maybe we can slowly increase the sleep to stop shortly if the resource goes away shortly.
deadline = time.monotonic() + 60.0
sleep = 0.010
while ...:
if ....: break
if time.monotonic() > deadline: ... assert error ...
sleep = min(sleep * 2, 5.0)
time.sleep(1.0)
It's kind of a common pattern. Maybe it should be an helper in test.support module.
> We can do that, or maybe we can try to wait on the `resource_tracker's` pid?
I prefer to make sure that the resource goes away without inspecting multiprocessing internals. |
|
| 日期 |
用户 |
动作 |
参数 |
| 2019-05-13 13:09:26 | vstinner | 修改 | recipients:
+ vstinner, pitrou, Olivier.Grisel, pablogsal, xtreak, pierreglaser |
| 2019-05-13 13:09:26 | vstinner | 修改 | messageid: <1557752966.56.0.444241882542.issue36867@roundup.psfhosted.org> |
| 2019-05-13 13:09:26 | vstinner | 链接 | issue36867 messages |
| 2019-05-13 13:09:26 | vstinner | 创建 | |
|