stick around to hog resources and create problems when looking
for refleaks.
"""
-
# Reap all our dead child processes so we don't leave zombies around.
# These hog resources and might be causing some of the buildbots to die.
if hasattr(os, 'waitpid'):
pid, status = os.waitpid(any_process, os.WNOHANG)
if pid == 0:
break
+ print("Warning -- reap_children() reaped child process %s"
+ % pid, file=sys.stderr)
except:
break
worker_count = 5
def setUp(self):
+ self._thread_cleanup = test.support.threading_setup()
+
self.t1 = time.time()
try:
self.executor = self.executor_type(max_workers=self.worker_count)
def tearDown(self):
self.executor.shutdown(wait=True)
+ self.executor = None
+
dt = time.time() - self.t1
if test.support.verbose:
print("%.2fs" % dt, end=' ')
self.assertLess(dt, 60, "synchronization issue: test lasted too long")
+ test.support.threading_cleanup(*self._thread_cleanup)
+ test.support.reap_children()
+
def _prime_executor(self):
# Make sure that the executor is ready to do work before running the
# tests. This should reduce the probability of timeouts in the tests.