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

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

    XMLWordPrintable

Details

    • MOODLE_38_STABLE
    • MOODLE_37_STABLE, MOODLE_38_STABLE
    • wip-MDL-67339-master
    • 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. "    

    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

            jb23347 John Beedell
            jb23347 John Beedell
            Sam Marshall Sam Marshall
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Gladys Basiana Gladys Basiana
            Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              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