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

Slow behat tests for backup

    XMLWordPrintable

Details

    • 5
    • 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

            dobedobedoh Andrew Lyons
            dobedobedoh Andrew Lyons
            Rajesh Taneja Rajesh Taneja
            Marina Glancy Marina Glancy
            Mark Nelson Mark Nelson
            Adrian Greeve, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              14/Jul/14