Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-45935

Slow behat tests for backup

    XMLWordPrintable

    Details

    • Story Points:
      5
    • Sprint:
      FRONTEND Sprint 12

      Description

      When we run behat backup tests, we pass a table such as:

          When I backup "Course 2" course using this options:
            | Filename | test_backup.mbz |
            | setting_section_section_2_userinfo | 0 |
            | setting_section_section_2_included | 0 |
            | setting_section_section_4_userinfo | 0 |
            | setting_section_section_4_included | 0 |
      

      We then call i_backup_course_using_this_options, passing in those options. That in turn handles the backup process looking at each page.

      At each page, it uses the following to fill in the form:

      $this->fill_backup_restore_form($options);
      

      Which then looks for each option in the table and fills it in. Since most of those settings are only found on one page, we then wait 12 seconds for the search for that option to fail to be found (which we ignore with a try/catch).

      https://github.com/moodle/moodle/blob/master/backup/util/ui/tests/behat/behat_backup.php#L351

      The result is that each test involving backups takes a good minute just to fill in the each page of the backup form, for three pages making about 3 minutes of wasted time in timeouts. By fixing this, we should be able to knock a good few minutes off behat runtimes.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                14/Jul/14