summaryrefslogtreecommitdiff
path: root/buildscripts
diff options
context:
space:
mode:
authorJonathan Abrahams <jonathan@mongodb.com>2018-04-17 23:21:30 -0400
committerJonathan Abrahams <jonathan@mongodb.com>2018-04-17 23:21:30 -0400
commitf1dce2d1934052cbac4032d0c5833d3857a0cfb2 (patch)
treecf7ec9d062052df8e0786f2bfcd725d12f11db51 /buildscripts
parenta6411b4e7ac800272d7835fe77c6bc55516efa03 (diff)
downloadmongo-f1dce2d1934052cbac4032d0c5833d3857a0cfb2.tar.gz
SERVER-24924 Fix Exceptions during resmoke.py execution do not cause task failures
Diffstat (limited to 'buildscripts')
-rw-r--r--buildscripts/resmokelib/testing/executor.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/buildscripts/resmokelib/testing/executor.py b/buildscripts/resmokelib/testing/executor.py
index 3df4a0a5059..edc778da915 100644
--- a/buildscripts/resmokelib/testing/executor.py
+++ b/buildscripts/resmokelib/testing/executor.py
@@ -53,13 +53,13 @@ class TestSuiteExecutor(object):
# Only start as many jobs as we need. Note this means that the number of jobs we run may
# not actually be _config.JOBS or self._suite.options.num_jobs.
jobs_to_start = self._suite.options.num_jobs
- num_tests = len(suite.tests)
+ self.num_tests = len(suite.tests)
- if num_tests < jobs_to_start:
+ if self.num_tests < jobs_to_start:
self.logger.info(
"Reducing the number of jobs from %d to %d since there are only %d test(s) to run.",
- self._suite.options.num_jobs, num_tests, num_tests)
- jobs_to_start = num_tests
+ self._suite.options.num_jobs, self.num_tests, self.num_tests)
+ jobs_to_start = self.num_tests
# Must be done after getting buildlogger configuration.
self._jobs = [self._make_job(job_num) for job_num in xrange(jobs_to_start)]
@@ -112,6 +112,13 @@ class TestSuiteExecutor(object):
if self._suite.options.fail_fast:
break
+ test_report = report.as_dict()
+ test_results_num = len(test_report["results"])
+ # There should be at least as many tests results as expected number of tests.
+ if test_results_num < self.num_tests:
+ raise errors.ResmokeError("{} reported tests is less than {} expected tests"
+ .format(test_results_num, self.num_tests))
+
# Clear the report so it can be reused for the next execution.
for job in self._jobs:
job.report.reset()