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

Allow restarting the browser session after a timeout expires

    Details

    • Testing Instructions:
      Hide

      This issue is a bit complicated to test. The proper way to test it is using saucelabs, forcing max-duration value (the setting that manages how much can a test run) to 600 seconds for example and set $CFG->behat_restart_browser_after = 200; I've tested it in nightly01 avoiding the saucelabs 10800 seconds limit and restarting after 7200 seconds, also I've tested it locally to ensure there are no regressions and the browser is restarted as expected.

      Test 1 (no regressions)

      1. With the setting disabled (default value)
      2. Run behat with --tags @mod_forum (for example)
      3. It SHOULD finish without any exception that stops the tests execution

      Test 2 (is restarted properly)

      1. In config.php set $CFG->behat_restart_browser_after to 30, so the browser will be restarted after each test (not 100% sure but probably all the tests lasts for more than 30 seconds)
      2. Edit lib/tests/behat/behat_hooks.php, and add a die('MDL-39686'); just before $this->getSession()->restart();
      3. Run behat with --tags @mod_forum (for example, will work with anything that has more than one scenario)
      4. After finishing the first scenario it SHOULD die with a MDL-39686 message
      5. git checkout lib/tests/behat/behat_hooks.php
      6. Run behat with --tags @mod_forum (for example, will work with anything that has more than one scenario)
      7. The test run SHOULD finish as expected without any exception that stops the tests execution
      Show
      This issue is a bit complicated to test. The proper way to test it is using saucelabs, forcing max-duration value (the setting that manages how much can a test run) to 600 seconds for example and set $CFG->behat_restart_browser_after = 200; I've tested it in nightly01 avoiding the saucelabs 10800 seconds limit and restarting after 7200 seconds, also I've tested it locally to ensure there are no regressions and the browser is restarted as expected. Test 1 (no regressions) With the setting disabled (default value) Run behat with --tags @mod_forum (for example) It SHOULD finish without any exception that stops the tests execution Test 2 (is restarted properly) In config.php set $CFG->behat_restart_browser_after to 30, so the browser will be restarted after each test (not 100% sure but probably all the tests lasts for more than 30 seconds) Edit lib/tests/behat/behat_hooks.php, and add a die(' MDL-39686 '); just before $this->getSession()->restart(); Run behat with --tags @mod_forum (for example, will work with anything that has more than one scenario) After finishing the first scenario it SHOULD die with a MDL-39686 message git checkout lib/tests/behat/behat_hooks.php Run behat with --tags @mod_forum (for example, will work with anything that has more than one scenario) The test run SHOULD finish as expected without any exception that stops the tests execution
    • Affected Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-39686_master

      Description

      Saucelabs allows 10000 seconds tests, which is not enough to run our whole suite, neither to run @_cross_browser features. We can restart the browser session after X seconds to avoid it.

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  8/Jul/13