diff options
Diffstat (limited to 'buildscripts/resmokelib/core/process.py')
-rw-r--r-- | buildscripts/resmokelib/core/process.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/buildscripts/resmokelib/core/process.py b/buildscripts/resmokelib/core/process.py index b8efa8af25a..eaa03cb241c 100644 --- a/buildscripts/resmokelib/core/process.py +++ b/buildscripts/resmokelib/core/process.py @@ -163,12 +163,12 @@ class Process(object): if return_code == win32con.STILL_ACTIVE: raise - def stop(self): + def stop(self, kill=False): """Terminate the process.""" if sys.platform == "win32": # Attempt to cleanly shutdown mongod. - if len(self.args) > 0 and self.args[0].find("mongod") != -1: + if not kill and len(self.args) > 0 and self.args[0].find("mongod") != -1: mongo_signal_handle = None try: mongo_signal_handle = win32event.OpenEvent( @@ -214,7 +214,10 @@ class Process(object): raise else: try: - self._process.terminate() + if kill: + self._process.kill() + else: + self._process.terminate() except OSError as err: # ESRCH (errno=3) is received when the process has already died. if err.errno != 3: |