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

Ad Hoc tasks improvements - display fail delay & allow it to be reset

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.3.5, 4.4.1
    • Tasks
    • MOODLE_403_STABLE, MOODLE_404_STABLE
    • MDL-81780-Adhoc-task-improvements
    • Hide

           1. Create Adhoc Tasks Using the Adhoc Task Test Tool:

      • Use the tool from https://github.com/catalyst/moodle-tool_testtasks.
      • Run these CLI commands to create tasks:
      • `php admin/tool/testtasks/cli/queue_adhoc_tasks.php --successrate=0` to generate `timed_adhoc_task` instances that will fail.
      • `php admin/cli/adhoc_task.php --execute` to run the task we created that we know will fail.
      • `php admin/tool/testtasks/queue_adhoc_tasks.php` to generate standard `timed_adhoc_task` instances.

      2. Verify Generation of `timed_adhoc_task` Instances:

      • Go to Site administration > Server > Adhoc tasks.
      • Check that the `timed_adhoc_task` instances appear in the task list.

      3. Check Fail Delay Display:

      • Look at the `timed_adhoc_task` entries in the table.
      • click on `timed_adhoc_task` link for summary of tasks.
      • You should see a "Fail delay" column or message showing how long the system will wait before trying to run the failed task again. The value for the failed task should be 60.

      4. Verify Next Run Time:

      • Check the "Next run" column to see the correct time for the next scheduled execution which should be close the time it was generated by the cli.

      5. Test Deleting `timed_adhoc_task`:

      • On the task summary page, click the Delete button to remove the task that failed.
      • Make sure the task is removed.

      6. Generate More Adhoc Tasks:

      • Run the CLI commands again to generate more tasks:
      • `php queue_adhoc_tasks.php --successrate=0`
      • `php admin/cli/adhoc_task.php --execute` to run the task we created that we know will fail.
      • `php queue_adhoc_tasks.php`

      7. Run Due Tasks Only:

      • Go back to Site administration > Server > Adhoc tasks.
      • Click the "Run due only" button.
      • Ensure that only the tasks that are due (and not failed) are executed.
      • You should see "success: 100" and not see "success: 0"' in the "Adhoc task custom data" output for each task
      Show
           1. Create Adhoc Tasks Using the Adhoc Task Test Tool: Use the tool from https://github.com/catalyst/moodle-tool_testtasks . Run these CLI commands to create tasks: `php admin/tool/testtasks/cli/queue_adhoc_tasks.php --successrate=0` to generate `timed_adhoc_task` instances that will fail. `php admin/cli/adhoc_task.php --execute` to run the task we created that we know will fail. `php admin/tool/testtasks/queue_adhoc_tasks.php` to generate standard `timed_adhoc_task` instances. 2. Verify Generation of `timed_adhoc_task` Instances: Go to Site administration > Server > Adhoc tasks. Check that the `timed_adhoc_task` instances appear in the task list. 3. Check Fail Delay Display: Look at the `timed_adhoc_task` entries in the table. click on `timed_adhoc_task` link for summary of tasks. You should see a "Fail delay" column or message showing how long the system will wait before trying to run the failed task again. The value for the failed task should be 60. 4. Verify Next Run Time: Check the "Next run" column to see the correct time for the next scheduled execution which should be close the time it was generated by the cli. 5. Test Deleting `timed_adhoc_task`: On the task summary page, click the Delete button to remove the task that failed. Make sure the task is removed. 6. Generate More Adhoc Tasks: Run the CLI commands again to generate more tasks: `php queue_adhoc_tasks.php --successrate=0` `php admin/cli/adhoc_task.php --execute` to run the task we created that we know will fail. `php queue_adhoc_tasks.php` 7. Run Due Tasks Only: Go back to Site administration > Server > Adhoc tasks. Click the "Run due only" button. Ensure that only the tasks that are due (and not failed) are executed. You should see "success: 100" and not see "success: 0"' in the "Adhoc task custom data" output for each task
    • Hide

      Code verified against automated checks with warnings.

      Checked MDL-81780 using repository: https://github.com/waleedhassan5/moodle.git

      Should these errors be fixed?

      Built on: Mon 21 Oct 2024 06:26:27 AM UTC

      Show
      Code verified against automated checks with warnings. Checked MDL-81780 using repository: https://github.com/waleedhassan5/moodle.git main (0 errors / 1 warnings) [branch: MDL-81780-Adhoc-task-improvements | CI Job ] overview (0/1) , phplint (0/0) , phpcs (0/0) , js (0/0) , css (0/0) , phpdoc (0/0) , commit (0/0) , savepoint (0/0) , thirdparty (0/0) , externalbackup (0/0) , grunt (0/0) , shifter (0/0) , mustache (0/0) , gherkin (0/0) , Warn: The MDL-81780 -Adhoc-task-improvements branch at https://github.com/waleedhassan5/moodle.git has not been rebased recently (>20 days ago). Should these errors be fixed? Built on: Mon 21 Oct 2024 06:26:27 AM UTC
    • Show
      Launching automatic jobs for branch MDL-81780 -Adhoc-task-improvements https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/17053/ PHPUnit (sqlsrv) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/58052/ Behat (NonJS - boost and classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/58053/ Behat (Firefox - boost) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/58054/ Behat (Firefox - classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/58055/ App tests (stable app version) Built on: Mon Oct 21 06:25:13 AM UTC 2024

      Ad Hoc tasks still need some improvements:

      1. when task fail, a fail delay affects newly created adhoc tasks pushing them to run a long way in the future, however this delay is not displayed in the web interface & there is no way to reset it after the issue has been resolved
      2. tasks  due to run in the future have no information provided - it should be possible to see them, there should probably also be a way to run them early
      3. when a task is going to keep failing forever because the payload format required has changed and we know that it's safe to delete the task and trigger a new call that will send an updated payload - there is currently no way to delete this task through the web interface (have to resolve to doing this via the database)
      4. When you click on "Run all" under "Ad hoc tasks due" it always runs the failed tasks first. This is not the expected behaviour, if I wanted to do that, I would have clicked the "Run all" under the "Ad hoc tasks failed". It also fails to run the tasks due and only runs the failed tasks which again isn't the desired behaviour

       

            Unassigned Unassigned
            aspark Alistair Spark
            Mark Johnson Mark Johnson
            Votes:
            4 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 6 minutes
                6m

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