diff --git a/presubmit_support.py b/presubmit_support.py index 5851178f1..342388e64 100755 --- a/presubmit_support.py +++ b/presubmit_support.py @@ -563,6 +563,11 @@ class InputApi(object): msgs.extend(map(CallCommand, tests)) return [m for m in msgs if m] + def ShutdownPool(self): + self._run_tests_pool.close() + self._run_tests_pool.join() + self._run_tests_pool = None + class _DiffCache(object): """Caches diffs retrieved from a particular SCM.""" @@ -1448,6 +1453,8 @@ class PresubmitExecuter(object): else: result = () # no error since the script doesn't care about current event. + input_api.ShutdownPool() + # Return the process to the original working directory. os.chdir(main_path) return result diff --git a/tests/presubmit_unittest.py b/tests/presubmit_unittest.py index 762960283..807bad337 100755 --- a/tests/presubmit_unittest.py +++ b/tests/presubmit_unittest.py @@ -1253,6 +1253,7 @@ class InputApiUnittest(PresubmitTestsBase): 'ReadFile', 'RightHandSideLines', 'ServerPaths', + 'ShutdownPool', 'basename', 'cPickle', 'cpplint',