diff --git a/buildscripts/evergreen_generate_resmoke_tasks.py b/buildscripts/evergreen_generate_resmoke_tasks.py index 1aeee92404e..63ffd156080 100755 --- a/buildscripts/evergreen_generate_resmoke_tasks.py +++ b/buildscripts/evergreen_generate_resmoke_tasks.py @@ -857,7 +857,8 @@ class GenerateSubSuites(object): LOGGER.debug("Splitting tasks based on fallback", fallback=self.config_options.fallback_num_sub_suites) self.test_list = self.list_tests() - num_suites = min(self.config_options.fallback_num_sub_suites, len(self.test_list)) + num_suites = min(self.config_options.fallback_num_sub_suites, len(self.test_list), + self.config_options.max_sub_suites) suites = [Suite(self.config_options.suite) for _ in range(num_suites)] for idx, test_file in enumerate(self.test_list): suites[idx % num_suites].add_test(test_file, 0) diff --git a/buildscripts/tests/test_evergreen_generate_resmoke_tasks.py b/buildscripts/tests/test_evergreen_generate_resmoke_tasks.py index 50cd8ab29f3..a33e27fac5b 100644 --- a/buildscripts/tests/test_evergreen_generate_resmoke_tasks.py +++ b/buildscripts/tests/test_evergreen_generate_resmoke_tasks.py @@ -78,6 +78,7 @@ class TestAcceptance(unittest.TestCase): "project": "mongodb-mongo-master", "task_id": "task314", "task_name": "some_task_gen", + "max_sub_suites": 100, } @staticmethod @@ -811,11 +812,12 @@ class EvergreenConfigGeneratorTest(unittest.TestCase): class GenerateSubSuitesTest(unittest.TestCase): @staticmethod - def get_mock_options(n_fallback=2): + def get_mock_options(n_fallback=2, max_sub_suites=100): options = MagicMock() options.target_resmoke_time = 10 options.fallback_num_sub_suites = n_fallback options.max_tests_per_suite = None + options.max_sub_suites = max_sub_suites return options @staticmethod @@ -861,6 +863,24 @@ class GenerateSubSuitesTest(unittest.TestCase): self.assertEqual(n_tests, len(gen_sub_suites.test_list)) + def test_max_sub_suites_overrides_fallback(self): + n_tests = 100 + n_fallback = 5 + max_sub_suites = 1 + evg = mock_test_stats_unavailable(MagicMock()) + config_options = self.get_mock_options(n_fallback=n_fallback, max_sub_suites=max_sub_suites) + + gen_sub_suites = under_test.GenerateSubSuites(evg, config_options) + gen_sub_suites.list_tests = MagicMock(return_value=self.get_test_list(n_tests)) + + suites = gen_sub_suites.calculate_suites(_DATE, _DATE) + + self.assertEqual(max_sub_suites, len(suites)) + for suite in suites: + self.assertEqual(n_tests, len(suite.tests)) + + self.assertEqual(n_tests, len(gen_sub_suites.test_list)) + def test_calculate_suites_more_fallback_suites_than_tests(self): n_tests = 5 n_fallback = 10 diff --git a/etc/evergreen.yml b/etc/evergreen.yml index e94f71c3e7c..ca585c78163 100644 --- a/etc/evergreen.yml +++ b/etc/evergreen.yml @@ -9990,7 +9990,7 @@ buildvariants: - enterprise run_on: - rhel62-small - expansions: + expansions: &enterprise-rhel-62-64-bit-expansions additional_targets: archive-mongocryptd archive-mongocryptd-debug push_path: linux push_bucket: downloads.10gen.com @@ -10459,6 +10459,48 @@ buildvariants: - name: snmp - name: .updatefuzzer +# The following build variant is meant to provide a baseline to measure how much overhead we +# are spending when we split tasks into multiple sub-tasks. +- name: enterprise-rhel-62-64-bit-single-task-baseline + display_name: "Enterprise RHEL 6.2 (Single Task Baseline)" + batchtime: 10080 # 1 week. + modules: + - enterprise + run_on: + - rhel62-small + expansions: + <<: *enterprise-rhel-62-64-bit-expansions + max_sub_suites: 1 # Only generate 1 sub-suite per task. + tasks: + - name: compile_all_run_unittests_TG + distros: + - rhel62-large + - name: .aggregation + - name: .auth + - name: unittest_shell_hang_analyzer_gen + - name: .causally_consistent !.sharding + - name: .change_streams + - name: .misc_js + - name: .encrypt + - name: .jscore .common + - name: .logical_session_cache + - name: .multi_shard + - name: multi_stmt_txn_jscore_passthrough_with_migration_gen + - name: multiversion_gen + - name: .read_write_concern .large + distros: + - rhel62-large + - name: .read_write_concern !.large + - name: .replica_sets !.encrypt !.auth + distros: + - rhel62-large + - name: retryable_writes_jscore_passthrough_gen + - name: .read_only + - name: .sharding .jscore !.wo_snapshot !.multi_stmt + - name: .sharding .txns + - name: .sharding .common + - name: secondary_reads_passthrough_gen + - &enterprise-rhel-70-64-bit-template name: enterprise-rhel-70-64-bit display_name: "* Enterprise RHEL 7.0"