summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllison Easton <allison.easton@mongodb.com>2023-07-25 17:24:09 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-08-17 16:40:32 +0000
commitb684daf693dea7c92bb7a035a481ef74821f2f1c (patch)
treeda7326d77383ffbdc5c5a2d040285cf22a664c3f
parent8ce7148b986cc90fb5486e06c1a2ee4e438dc7b0 (diff)
SERVER-79103 Core dumps are not generated if stopping balancer fails
(cherry picked from commit a4f4d0afd0d7392c0ee3debccace2e9ab8a42375)
-rw-r--r--buildscripts/resmokelib/testing/job.py28
1 files changed, 24 insertions, 4 deletions
diff --git a/buildscripts/resmokelib/testing/job.py b/buildscripts/resmokelib/testing/job.py
index 3379dd51777..4a0c843a72f 100644
--- a/buildscripts/resmokelib/testing/job.py
+++ b/buildscripts/resmokelib/testing/job.py
@@ -286,10 +286,20 @@ class Job(object):
suite_with_balancer = isinstance(
self.fixture, shardedcluster.ShardedClusterFixture) and self.fixture.enable_balancer
- try:
- if not background and suite_with_balancer:
+ if not background and suite_with_balancer:
+ try:
self.logger.info("Stopping the balancer before running end-test hooks")
self.fixture.stop_balancer()
+ except:
+ self.logger.exception("%s failed while stopping the balancer for end-test hooks",
+ test.short_description())
+ self.report.setFailure(test, return_code=2)
+ if self.archival:
+ result = TestResult(test=test, hook=None, success=False)
+ self.archival.archive(self.logger, result, self.manager)
+ raise errors.StopExecution("stop_balancer failed before running after test hooks")
+
+ try:
for hook in self.hooks:
if hook.IS_BACKGROUND == background:
self._run_hook(hook, hook.after_test, test, hook_failure_flag)
@@ -315,8 +325,18 @@ class Job(object):
raise
if not background and suite_with_balancer:
- self.logger.info("Resuming the balancer after running end-test hooks")
- self.fixture.start_balancer()
+ try:
+ self.logger.info("Resuming the balancer after running end-test hooks")
+ self.fixture.start_balancer()
+ except:
+ self.logger.exception(
+ "%s failed while re-starting the balancer after end-test hooks",
+ test.short_description())
+ self.report.setFailure(test, return_code=2)
+ if self.archival:
+ result = TestResult(test=test, hook=None, success=False)
+ self.archival.archive(self.logger, result, self.manager)
+ raise errors.StopExecution("start_balancer failed after running after test hooks")
def _fail_test(self, test, exc_info, return_code=1):
"""Provide helper to record a test as a failure with the provided return code.