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

Asynchronous restore keeps deleting course/student content - Using no-retry flag

XMLWordPrintable

    • MOODLE_404_STABLE
    • MOODLE_404_STABLE
    • MDL-80267-main
    • Hide

      Make sure you don't have any tasks queued in task_adhoc table so it's easy to track the recently added tasks

      PHPUnit

      Verify that all the tests in the below file are pased

      lib/tests/task/adhoc_task_test.php

      Initial setup

      1. Add this line to your config.php: 

      $CFG->debug_developer_use_pretty_exceptions = false;

      1. Login as admin.
      2. Navigate to Site Administration.
      3. Enable enableasyncbackup setting (Checked).
      4. Create a course called "Test restore course".
      5. Navigate to the created course.
      6. Create some activities (Assign, Quiz...).
      7. Back up that course.
      8. Run php admin/cli/adhoc_task.php --execute to complete the backup process.
      9. Download that backup and save it somewhere.
      10. Apply the Patch_to_test_MDL-75579.patchpatch.

      Testing

      1. Navigate to the created course.
      2. Click on More > Course reuse > Restore.
      3. Upload and restore the downloaded backup.
      4. In the Destination stage, make sure to select Delete the contents of this course and then restore option in "Restore into this course".
      5. Run php admin/cli/adhoc_task.php --execute to complete the restore process.
      6. Verify that you see the below message in the terminal.

        Exception thrown during restore execution, marking job as failed
        error/test-75579-exception

      7. Go to the restored course.
      8. You will have an exception page - refresh the page
      9. Verify that all the course contents are deleted.
      10. Click on More > Course reuse > Restore.
      11. Verify that you do not see a pending restore process.
      12. Go to Site Administration > Server > Adhoc tasks.
      13. Verify that you don't see any failed records with classname is "asynchronous_restore_task"
      Show
      Make sure you don't have any tasks queued in task_adhoc table so it's easy to track the recently added tasks PHPUnit Verify that all the tests in the below file are pased lib/tests/task/adhoc_task_test.php Initial setup Add this line to your config.php:  $CFG->debug_developer_use_pretty_exceptions = false ; Login as admin. Navigate to Site Administration. Enable enableasyncbackup setting (Checked). Create a course called "Test restore course". Navigate to the created course. Create some activities (Assign, Quiz...). Back up that course. Run php admin/cli/adhoc_task.php --execute to complete the backup process. Download that backup and save it somewhere. Apply the Patch_to_test_MDL-75579.patch patch. Testing Navigate to the created course. Click on More > Course reuse > Restore. Upload and restore the downloaded backup. In the Destination stage, make sure to select Delete the contents of this course and then restore  option in "Restore into this course". Run php admin/cli/adhoc_task.php --execute to complete the restore process. Verify that you see the below message in the terminal. Exception thrown during restore execution, marking job as failed error/test-75579-exception Go to the restored course. You will have an exception page - refresh the page Verify that all the course contents are deleted. Click on More > Course reuse > Restore. Verify that you do not see a pending restore process. Go to Site Administration > Server > Adhoc tasks. Verify that you don't see any failed records with classname is "asynchronous_restore_task"
    • 2
    • Team Hedgehog 2023 Sprint 4.2, Team Hedgehog 2023 Sprint 4.3, Team Hedgehog 2023 Review 4, Team Hedgehog 2024 Sprint 1.1

      This one is created to fix the issue of MDL-75579, but for the master-main only using the no-retry flag of MDL-79128  

            huongn@moodle.com Huong Nguyen
            huongn@moodle.com Huong Nguyen
            Meirza Meirza
            Ilya Tregubov Ilya Tregubov
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 days, 6 hours, 53 minutes
                4d 6h 53m

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