Author vstinner
Recipients Olivier.Grisel, pablogsal, pierreglaser, pitrou, vstinner, xtreak
Date 2019-05-13.13:09:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1557752966.56.0.444241882542.issue36867@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2019-05-13 13:09:26vstinnersetrecipients: + vstinner, pitrou, Olivier.Grisel, pablogsal, xtreak, pierreglaser
2019-05-13 13:09:26vstinnersetmessageid: <1557752966.56.0.444241882542.issue36867@roundup.psfhosted.org>
2019-05-13 13:09:26vstinnerlinkissue36867 messages
2019-05-13 13:09:26vstinnercreate