Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-41108

evergreen_generate_resmoke_tasks fails with a divide by zero exception

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 4.1.12
    • None
    • Testing Infrastructure
    • None
    • Fully Compatible
    • ALL
    • DAG 2019-05-20, DAG 2019-06-03

    Description

      It looks like we will occasionally get results from the test history endpoint that do not have any recorded executions. The code to split resmoke tasks assumes there will be at least one execution. When there are 0, it will hit an exception. We should handle that case.

      See this failure for an example.

      [2019/05/13 00:24:05.571] [2019-05-13 04:24:05,571 - evergreen.api - DEBUG] Request https://evergreen.mongodb.com/rest/v2/projects/mongodb-mongo-master/test_stats?after_date=2019-04-29&before_date=2019-05-13&group_by=test&group_num_days=14&limit=1000&start_at=2019-04-29%7C%7C%7Cobjid5%3ACheckReplDBHashInBackground%7C&tasks=sharded_causally_consistent_jscore_passthrough&variants=enterprise-rhel-62-64-bit-inmem took 0.140000s
       [2019/05/13 00:24:05.578] /data/mci/8d603e2dae92bed62271bec6d86d3b5e/src/buildscripts/util/read_config.py:42: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
       [2019/05/13 00:24:05.578]   config_file_data = yaml.load(file_handle)
       [2019/05/13 00:24:05.580] Traceback (most recent call last):
       [2019/05/13 00:24:05.580]   File "buildscripts/evergreen_generate_resmoke_tasks.py", line 709, in <module>
       [2019/05/13 00:24:05.580]     Main(EvergreenApi.get_api(config_file=CONFIG_FILE)).main()
       [2019/05/13 00:24:05.580]   File "buildscripts/evergreen_generate_resmoke_tasks.py", line 698, in main
       [2019/05/13 00:24:05.580]     suites = self.calculate_suites(start_date, end_date)
       [2019/05/13 00:24:05.580]   File "buildscripts/evergreen_generate_resmoke_tasks.py", line 621, in calculate_suites
       [2019/05/13 00:24:05.580]     return self.calculate_suites_from_evg_stats(evg_stats, target_execution_time_secs)
       [2019/05/13 00:24:05.580]   File "buildscripts/evergreen_generate_resmoke_tasks.py", line 644, in calculate_suites_from_evg_stats
       [2019/05/13 00:24:05.580]     test_stats = TestStats(data)
       [2019/05/13 00:24:05.580]   File "buildscripts/evergreen_generate_resmoke_tasks.py", line 460, in __init__
       [2019/05/13 00:24:05.580]     self._add_stats(doc)
       [2019/05/13 00:24:05.580]   File "buildscripts/evergreen_generate_resmoke_tasks.py", line 469, in _add_stats
       [2019/05/13 00:24:05.580]     self._add_test_hook_stats(test_file, duration, num_run)
       [2019/05/13 00:24:05.580]   File "buildscripts/evergreen_generate_resmoke_tasks.py", line 480, in _add_test_hook_stats
       [2019/05/13 00:24:05.580]     self._add_runtime_info(self._hook_runtime_by_test, test_name, duration, num_run)
       [2019/05/13 00:24:05.580]   File "buildscripts/evergreen_generate_resmoke_tasks.py", line 490, in _add_runtime_info
       [2019/05/13 00:24:05.580]     runtime_info["duration"], runtime_info["num_run"], duration, num_run)
       [2019/05/13 00:24:05.580]   File "buildscripts/evergreen_generate_resmoke_tasks.py", line 496, in _average
       [2019/05/13 00:24:05.580]     return float(value_a * num_a + value_b * num_b) / (num_a + num_b)
       [2019/05/13 00:24:05.580] ZeroDivisionError: float division by zero
       [2019/05/13 00:24:05.605] Command failed: command encountered problem: exit status 1
      

      {
      "test_file": "sort_numeric:CleanEveryN",
      "task_name": "",
      "variant": "",
      "distro": "",
      "date": "2019-04-29",
      "num_pass": 0,
      "num_fail": 0,
      "avg_duration_pass": 0
      }
      

      Attachments

        Activity

          People

            lydia.stepanek@mongodb.com Lydia Stepanek (Inactive)
            david.bradford@mongodb.com David Bradford (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: