From cf57e33764ba12a6a30ba6b75ef2aa3ccc192a78 Mon Sep 17 00:00:00 2001 From: Max Hirschhorn Date: Mon, 27 May 2019 08:56:11 -0400 Subject: SERVER-41169 Add powercycle Evergreen tasks to SSL Ubuntu 16.04 builder. --- etc/evergreen.yml | 14 +++++++++++++- pytests/powertest.py | 5 ++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/etc/evergreen.yml b/etc/evergreen.yml index a039b667a16..ce16e66780a 100644 --- a/etc/evergreen.yml +++ b/etc/evergreen.yml @@ -2390,7 +2390,10 @@ functions: cmds="$cmds; fi" cmds="$cmds; else echo Cannot change the core pattern and no core dumps will be generated." cmds="$cmds; fi" - cmds="$cmds; $sudo reboot" + # The following line for restarting the machine is based on + # https://unix.stackexchange.com/a/349558 in order to ensure the ssh client gets a + # response from the remote machine before it restarts. + cmds="$cmds; nohup $sudo reboot &>/dev/null & exit" ssh_connection_options="${ssh_identity} ${ssh_connection_options}" ${activate_virtualenv} $python buildscripts/remote_operations.py \ @@ -8269,6 +8272,15 @@ buildvariants: - name: .jstestfuzz .common - name: .logical_session_cache .one_sec - name: multiversion + - name: .powercycle + distros: + - ubuntu1604-powercycle + - name: powercycle_replication_smalloplog + distros: + - ubuntu1604-powercycle + - name: powercycle_write_concern_majority + distros: + - ubuntu1604-powercycle - name: replica_sets - name: watchdog_wiredtiger - name: .replica_sets .common diff --git a/pytests/powertest.py b/pytests/powertest.py index d1fcc29f499..f330a645a3b 100755 --- a/pytests/powertest.py +++ b/pytests/powertest.py @@ -772,7 +772,10 @@ class ProcessControl(object): """Return a list of 'proc' for the associated pids.""" procs = [] for pid in self.get_pids(): - procs.append(psutil.Process(pid)) + try: + procs.append(psutil.Process(pid)) + except psutil.NoSuchProcess: + pass return procs def is_running(self): -- cgit v1.2.1