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

Windows unit tests failures caused by backup controllers not being destroyed

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 3.9
    • Fix Version/s: 3.9
    • Component/s: Backup, Unit tests
    • Labels:
    • Testing Instructions:
      Hide
      Requisites
      • A PHP-enabled windows host [OR]
      • git abilities + github moodle clone repository with travis enabled.
      Steps
      • Run a complete phpunit run under Windows*
      • Verify it passes and, specifically, there aren't any "backup" unit test failing.

      * You can run this in your windows machine, of course. But also on travis by merging the travis_windows branch of https://github.com/stronk7/moodle.git on top of master and sending it to github (assuming you have travis integration enabled).

      Show
      Requisites A PHP-enabled windows host [OR] git abilities + github moodle clone repository with travis enabled. Steps Run a complete phpunit run under Windows* Verify it passes and, specifically, there aren't any "backup" unit test failing. * You can run this in your windows machine, of course. But also on travis by merging the travis_windows branch of https://github.com/stronk7/moodle.git on top of master and sending it to github (assuming you have travis integration enabled).
    • Affected Branches:
      MOODLE_39_STABLE
    • Fixed Branches:
      MOODLE_39_STABLE
    • Pull Master Branch:

      Description

      With latest roll (May 19th 2020), windows unit tests are back to fail with (legion of) errors like this:

      1) core_backup_async_helper_testcase::test_get_backup_record
      1235unlink(C:\Users\travis\roots\phpunitdata/temp/backup/e672a7b14886295d7b069afc7892e5f3.log): Resource temporarily unavailable
      

      Link: https://travis-ci.org/github/stronk7/moodle/builds/688922236

      That uses to happen when some backup or restore controller in tests is missing its corresponding ->destroy() call, usually in charge of closing file handlers, destroying circular structures and other bits. Under Windows, this is specially noticeably because it locks those files completely (while under Unix, everything passes ok).

      This is about to find the test / code missing the ->destroy() calls and add them, ensuring we are back to green with Windows.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              stronk7 Eloy Lafuente (stronk7)
              Reporter:
              stronk7 Eloy Lafuente (stronk7)
              Peer reviewer:
              Dmitrii Metelkin
              Integrator:
              Sara Arjona (@sarjona)
              Tester:
              Jun Pataleta
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                15/Jun/20

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours, 30 minutes
                  2h 30m