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

Enhance the Behat exception message '... code is extremely slow ...'

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Setup

      1. Open the file theme/boost/templates/login.mustache.
      2. Replace line 73 (for master and 3.8) or line 72 (for 3.7):

      M.util.js_complete('theme_boost/loader');

      with

      window.setTimeout(function(){M.util.js_complete('theme_boost/loader');}, 350000);

       

      Testing scenario

      • 1. Run the behat test in login/tests/behat/change_password.feature: scenario: "A user with expired password trying to visit a required login page must change and it and then be redirected to this page" 

        mdk behat -r -n "A user with expired password trying to visit a required login page must change and it and then be redirected to this page"

      • 2. Check it fails with this message in the console: "Javascript code and/or AJAX requests are not ready after 30 seconds. There is a Javascript error or the code is extremely slow (theme_boost/loader). If you are using a slow machine, consider setting $CFG->behat_increasetimeout."

       
       

      Show
      Setup Open the file theme/boost/templates/login.mustache . Replace line 73 (for master and 3.8) or line 72 (for 3.7): M.util.js_complete( 'theme_boost/loader' ); with window.setTimeout(function(){M.util.js_complete( 'theme_boost/loader' );}, 350000 );   Testing scenario 1. Run the behat test in login/tests/behat/change_password.feature: scenario: "A user with expired password trying to visit a required login page must change and it and then be redirected to this page"  mdk behat -r -n "A user with expired password trying to visit a required login page must change and it and then be redirected to this page" 2. Check it fails with this message in the console: " Javascript code and/or AJAX requests are not ready after 30 seconds. There is a Javascript error or the code is extremely slow (theme_boost/loader). If you are using a slow machine, consider setting $CFG->behat_increasetimeout. "    
    • Affected Branches:
      MOODLE_38_STABLE
    • Fixed Branches:
      MOODLE_37_STABLE, MOODLE_38_STABLE
    • Pull 3.7 Branch:
      wip-MDL-67339-37stable
    • Pull 3.8 Branch:
      wip-MDL-67339-38stable
    • Pull Master Branch:
      wip-MDL-67339-master

      Description

      This Behat Exception occurs occasionally: "Javascript code and/or AJAX requests are not ready after 10 seconds. There is a Javascript error or the code is extremely slow. If you are using a slow machine, consider setting $CFG->behat_increasetimeout."

      It would be very useful when debugging this sort of exception if some clue to the javascript file was presented in the message. There can be many javascript files that could be the cause, and an indicator within this message would save a lot of time.

        Attachments

          Activity

            People

            Assignee:
            jb23347 John Beedell
            Reporter:
            jb23347 John Beedell
            Peer reviewer:
            Sam Marshall
            Integrator:
            Sara Arjona (@sarjona)
            Tester:
            Gladys Basiana
            Participants:
            Component watchers:
            Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              13/Jan/20

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 30 minutes
                1h 30m