summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_multiprocessing.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2013-03-11 19:39:18 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2013-03-11 19:39:18 (GMT)
commitdc6763b567d3dc35467e3be4b01ae5d6c27d9c1b (patch)
tree760073d865fd735e46b900c0161cf86bd5b0e43f /Lib/test/test_multiprocessing.py
parent37474f43f3b8a45aa2b7bd852596ba5696c54a9b (diff)
downloadcpython-dc6763b567d3dc35467e3be4b01ae5d6c27d9c1b.zip
cpython-dc6763b567d3dc35467e3be4b01ae5d6c27d9c1b.tar.gz
cpython-dc6763b567d3dc35467e3be4b01ae5d6c27d9c1b.tar.bz2
#17395: wait for live children in test_multiprocessing.
Diffstat (limited to 'Lib/test/test_multiprocessing.py')
-rw-r--r--Lib/test/test_multiprocessing.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/test/test_multiprocessing.py b/Lib/test/test_multiprocessing.py
index 53c8c1f..6cda4fa 100644
--- a/Lib/test/test_multiprocessing.py
+++ b/Lib/test/test_multiprocessing.py
@@ -2998,7 +2998,13 @@ class ManagerMixin(object):
@classmethod
def tearDownClass(cls):
- multiprocessing.active_children() # discard dead process objs
+ # only the manager process should be returned by active_children()
+ # but this can take a bit on slow machines, so wait a few seconds
+ # if there are other children too (see #17395)
+ t = 0.01
+ while len(multiprocessing.active_children()) > 1 and t < 5:
+ time.sleep(t)
+ t *= 2
gc.collect() # do garbage collection
if cls.manager._number_of_objects() != 0:
# This is not really an error since some tests do not