summaryrefslogtreecommitdiff
path: root/buildscripts
diff options
context:
space:
mode:
authorGregory Wlodarek <gregory.wlodarek@mongodb.com>2022-04-26 02:45:47 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-04-26 12:32:29 +0000
commit2b31ab005060690d46e4a6d08c7c504005118450 (patch)
tree200f54a442611da1953a2739bd3f646fbb7b26b9 /buildscripts
parent1b70d1396650b8345b51c3a36f0cc77aa937d4a5 (diff)
downloadmongo-2b31ab005060690d46e4a6d08c7c504005118450.tar.gz
SERVER-65945 Skip reporting simulate crash hook errors when a test failed
(cherry picked from commit 677bfe19c6e0c02625c26409033e7c574d072003)
Diffstat (limited to 'buildscripts')
-rw-r--r--buildscripts/resmokelib/testing/hooks/simulate_crash.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/buildscripts/resmokelib/testing/hooks/simulate_crash.py b/buildscripts/resmokelib/testing/hooks/simulate_crash.py
index 645ff9a4f35..aba383daf28 100644
--- a/buildscripts/resmokelib/testing/hooks/simulate_crash.py
+++ b/buildscripts/resmokelib/testing/hooks/simulate_crash.py
@@ -126,3 +126,15 @@ class SimulateCrash(bghook.BGHook):
shutil.rmtree(path, ignore_errors=True)
return True
+
+ def after_test(self, test, test_report):
+ """Each test will call this after it executes. Check if the hook found an error."""
+ self._background_job.kill()
+ self._background_job.join()
+
+ if self._background_job.err is not None and test_report.wasSuccessful():
+ self.logger.error("Encountered an error inside the hook after all tests passed: %s.",
+ self._background_job.err)
+ raise self._background_job.err
+ else:
+ self.logger.info("Reached end of cycle in the hook, killing background thread.")