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

phpunit failures in backup

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.7
    • 3.7
    • Backup, Unit tests
    • MOODLE_37_STABLE
    • MOODLE_37_STABLE
    • Hide

      Requisites:

      1. To use phpunit 7.5.8 or above. That can be achieved by 1) waiting MDL-65499 to be integrated or 2) remove the composer.lock file and running composer update.
      2. Windows

      Steps

      1. Under Windows, perform a complete phpunit run. Any supported database or php version is ok.
      2. Verify that there aren't errors like those shown @ https://pastebin.com/TQ6NZR67 ("Warning: unlink...", "Warning rmdir..." corresponding to tmp/backup files and dirs).

      Important note: At this stage, there could be other failures under Windows. We are, right now, completing the Moodle 3.7 release testing matrix and they will be handled there. So, at all effects, they can be ignored here. This issue is only about the (open/busy/locked) problems described above.

       

      Show
      Requisites: To use phpunit 7.5.8 or above. That can be achieved by 1) waiting  MDL-65499 to be integrated or 2) remove the composer.lock file and running composer update. Windows Steps Under Windows, perform a complete phpunit run. Any supported database or php version is ok. Verify that there aren't errors like those shown @ https://pastebin.com/TQ6NZR67 ("Warning: unlink...", "Warning rmdir..." corresponding to tmp/backup files and dirs). Important note : At this stage, there could be other failures under Windows. We are, right now, completing the Moodle 3.7 release testing matrix and they will be handled there. So, at all effects, they can be ignored here. This issue is only about the (open/busy/locked) problems described above.  

      While running phpunit tests under Windows to complete the 3.7 release testing matrix it has been detected that, from a point, all test start to fail with "Invalid permissions/files locked" problems.

      Tracing down the problem, it seems that some backup tests (at very least) are not properly destroying the backup/restore controllers. That leaves files (logs, temps...) not closed.

      While that's not a problem in unix... under windows that leads to files locked so they cannot be removed as part of the standard reset process between tests, causing ALL them to fail.

      This issue is about to detect all the places where we are leaving controllers not explicitly destroyed and proceed to do it.

      Note: To reproduce this properly, ideally you should update your phpunit to current 7.5.8 or higher. There is a bug in 7.5.7 making this bug unintelligible. See linked issues.

            stronk7 Eloy Lafuente (stronk7)
            stronk7 Eloy Lafuente (stronk7)
            Simey Lameze Simey Lameze
            Andrew Lyons Andrew Lyons
            Jun Pataleta Jun Pataleta
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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

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