summaryrefslogtreecommitdiff
path: root/buildscripts
diff options
context:
space:
mode:
authorIan Boros <ian.boros@10gen.com>2017-10-09 16:59:24 -0400
committerIan Boros <ian.boros@10gen.com>2017-10-10 10:04:12 -0400
commit51414083aef24c27414a46f43ebb67df6fc183e7 (patch)
treedbb2e25a6424c0bb801b72027d48ec081832271e /buildscripts
parent9c3da7fb167fdcc2326abfcef7ee2320463b6712 (diff)
downloadmongo-51414083aef24c27414a46f43ebb67df6fc183e7.tar.gz
SERVER-31472 resmoke returns error code when StepDownThread terminates prematurely
Diffstat (limited to 'buildscripts')
-rw-r--r--buildscripts/resmokelib/testing/hooks/stepdown.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/buildscripts/resmokelib/testing/hooks/stepdown.py b/buildscripts/resmokelib/testing/hooks/stepdown.py
index f955eb6544d..46f91ab4cd0 100644
--- a/buildscripts/resmokelib/testing/hooks/stepdown.py
+++ b/buildscripts/resmokelib/testing/hooks/stepdown.py
@@ -3,6 +3,7 @@ Testing hook that periodically makes the primary of a replica set step down.
"""
from __future__ import absolute_import
+import sys
import time
import threading
@@ -64,21 +65,25 @@ class ContinuousStepdown(interface.CustomBehavior):
self._stepdown_thread.stop()
def before_test(self, test, test_report):
- self._check_thread()
+ self._check_thread(test, test_report)
self.logger.info("Resuming the stepdown thread.")
self._stepdown_thread.resume()
def after_test(self, test, test_report):
- self._check_thread()
+ self._check_thread(test, test_report)
self.logger.info("Pausing the stepdown thread.")
self._stepdown_thread.pause()
self.logger.info("Paused the stepdown thread.")
- def _check_thread(self):
+ def _check_thread(self, test, test_report):
if not self._stepdown_thread.is_alive():
msg = "The stepdown thread is not running."
self.logger.error(msg)
- raise errors.StopExecution(msg)
+ try:
+ raise errors.StopExecution(msg)
+ except errors.StopExecution:
+ test_report.addError(test, sys.exc_info())
+ raise
def _add_fixture(self, fixture):
if isinstance(fixture, replicaset.ReplicaSetFixture):