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

MDL-77186 cron_setup_user follow-ups

XMLWordPrintable

    • MOODLE_402_STABLE
    • MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE, MOODLE_401_STABLE
    • MDL-77837-401
    • MDL-77837-master
    • Hide

      To test that the changes to the adhoc task runner are okay:

      1. Run php admin/cli/cron.php to clear the queue
      2. Navigate to Administration > Courses > Backups > Asynchronous backup/restore
      3. Ensure that enableasyncbackup is checked (and save changes)
      4. Navigate to a course
      5. Navigate to the backup page:
        1. 4.1 + master: More menu -> Course re-use -> Backup
        2. 4.0 and earlier: More menu -> Backup and restore
      6. Run through the backup process to generate a course backup of the course
        1. You can use the "Jump to final step" button for this
        2. Note: This should run asynchronously and will not generate a backup immediately
      7. Run the adhoc cron runner:

        php admin/cli/adhoc_task.php -e
        

        1. Ensure that the backup task was picked up
        2. Ensure that it ran without any error
      8. Run the standard cron runner again (hopefully it's been a few minutes since you first ran it)

        php admin/cli/cron.php
        

        1. Confirm there were no errors
      9. Create a forum in a course with a number of users enrolled and with a subscription mode set to "Forced"
      10. Create a forum post in the forum, and check the "Mail now" flag (under Advanced)
      11. Run the main forum scheduled task:

        php admin/cli/scheduled_task.php --execute="\mod_forum\task\cron_task"
        

        Run the adhoc task runner again

      12. Run the adhoc cron runner:

        php admin/cli/adhoc_task.php -e
        

        1. Confirm that a load of adhoc tasks were run sending forum notifications
      13. Navigate to Site administration -> Server -> Tasks -> Task logs
        1. Confirm that each forum adhoc task was run as the user to who the message was intended

      Unit test changes

      These should be adequately tested by the unit tests in place

      Show
      To test that the changes to the adhoc task runner are okay: Run php admin/cli/cron.php to clear the queue Navigate to Administration > Courses > Backups > Asynchronous backup/restore Ensure that enableasyncbackup is checked (and save changes) Navigate to a course Navigate to the backup page: 4.1 + master: More menu -> Course re-use -> Backup 4.0 and earlier: More menu -> Backup and restore Run through the backup process to generate a course backup of the course You can use the "Jump to final step" button for this Note: This should run asynchronously and will not generate a backup immediately Run the adhoc cron runner: php admin/cli/adhoc_task.php -e Ensure that the backup task was picked up Ensure that it ran without any error Run the standard cron runner again (hopefully it's been a few minutes since you first ran it) php admin/cli/cron.php Confirm there were no errors Create a forum in a course with a number of users enrolled and with a subscription mode set to "Forced" Create a forum post in the forum, and check the "Mail now" flag (under Advanced) Run the main forum scheduled task: php admin/cli/scheduled_task.php --execute="\mod_forum\task\cron_task" Run the adhoc task runner again Run the adhoc cron runner: php admin/cli/adhoc_task.php -e Confirm that a load of adhoc tasks were run sending forum notifications Navigate to Site administration -> Server -> Tasks -> Task logs Confirm that each forum adhoc task was run as the user to who the message was intended Unit test changes These should be adequately tested by the unit tests in place

      As part of MDL-77186 the cron_setup_user function was moved from lib/sessionlib.php to the new core\cron class.

      In doing this, a number of long-standing issues were detected with:

      • misuse of cron_setup_user
      • missing uses of it before tasks are run
      • unit test issues
      • poor documentation on the function

      On master it was also detected that it was not moved to lib/deprecatedlib.php when it was deprecated too.

      This issue addresses these problems.

            dobedobedoh Andrew Lyons
            timhunt Tim Hunt
            Tim Hunt Tim Hunt
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours, 39 minutes
                4h 39m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.