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

phpunit execution is painfully slow



    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.6
    • Fix Version/s: BACKEND
    • Component/s: Unit tests
    • Labels:


      It takes some 20 minutes to execute all tests on my linux box, we need to make it faster - let's say 5 minutes...

      The arbitrary limit is hard to work with. With the current proposed changes, we see about 30% performance improvement. Those need to be made available for final review.

      Current major time users for postgresql install;
      25% pg_query_params. So waiting on the database.
      15% create_course(). Some overlaps with database, but a lot of time in creating courses.
      8% core\event\base::trigger. Trigger overhead is high. Much of this is around cache construction for purge_by_event. It's very slow that infrastructure.

      The only optimisation that has not been at least trialled is adding a default course to the initialisation database so that it's there for all test cases that want a basic course. It is likely best to adjust the data_generator to use it as most users wouldn't ever both to call a different function to create a basic course.

      There are unlogged issues that will be elaborated on during the day. See the following work in progress branch. https://github.com/mr-russ/moodle/tree/fastphpunit


          Issue Links



              • Votes:
                2 Vote for this issue
                9 Start watching this issue


                • Created: