summaryrefslogtreecommitdiff
path: root/pytests
diff options
context:
space:
mode:
authorJonathan Abrahams <jonathan@mongodb.com>2018-08-13 10:21:05 -0400
committerJonathan Abrahams <jonathan@mongodb.com>2018-08-13 12:49:08 -0400
commitf46d77c794e0da816ab4c93b0cb6ace2b771a428 (patch)
treea24b1753700472e83002733ba060a88cfb2be91d /pytests
parenta444720202d97795b71cf2daaaa2bea94b430ef9 (diff)
downloadmongo-f46d77c794e0da816ab4c93b0cb6ace2b771a428.tar.gz
SERVER-36431 Powercycle should check for existence of a process before accessing it's attributes
Diffstat (limited to 'pytests')
-rwxr-xr-xpytests/powertest.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/pytests/powertest.py b/pytests/powertest.py
index bbb2f9a72a7..72a4486fe75 100755
--- a/pytests/powertest.py
+++ b/pytests/powertest.py
@@ -763,8 +763,11 @@ class ProcessControl(object):
return self.pids
self.pids = []
for proc in psutil.process_iter():
- if proc.name() == self.name:
- self.pids.append(proc.pid)
+ try:
+ if proc.name() == self.name:
+ self.pids.append(proc.pid)
+ except psutil.NoSuchProcess:
+ pass
return self.pids
def get_name(self):