[3.8] bpo-38546: Fix concurrent.futures test_ressources_gced_in_workers() (GH-17652) by miss-islington · Pull Request #17653 · python/cpython
class EventfulGCObj(): def __init__(self, ctx): mgr = get_context(ctx).Manager() def __init__(self, mgr): self.event = mgr.Event()
def __del__(self):
self.assertTrue(obj.event.wait(timeout=1))
# explicitly destroy the object to ensure that EventfulGCObj.__del__() # is called while manager is still running. obj = None support.gc_collect()
mgr.shutdown() mgr.join()
create_executor_tests(ProcessPoolExecutorTest, executor_mixins=(ProcessPoolForkMixin,