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

Windows unit tests failures caused by backup controllers not being destroyed

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 3.9
    • 3.9
    • Backup, Unit tests
    • MOODLE_39_STABLE
    • MOODLE_39_STABLE
    • 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).

    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

              stronk7 Eloy Lafuente (stronk7)
              stronk7 Eloy Lafuente (stronk7)
              Dmitrii Metelkin Dmitrii Metelkin
              Sara Arjona (@sarjona) Sara Arjona (@sarjona)
              Jun Pataleta Jun Pataleta
              Adrian Greeve, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                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