# check that we indeed waited for all jobs
self.assertGreater(time.monotonic() - t_start, 0.9)
- @support.requires_gil_enabled("gh-118413: test is flaky with GIL disabled")
def test_release_task_refs(self):
# Issue #29861: task arguments and results should not be kept
# alive after we are done with them.
self.pool.map(identity, objs)
del objs
- gc.collect() # For PyPy or other GCs.
time.sleep(DELTA) # let threaded cleanup code run
+ support.gc_collect() # For PyPy or other GCs.
self.assertEqual(set(wr() for wr in refs), {None})
# With a process pool, copies of the objects are returned, check
# they were released too.