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

Unreleased lock throws exception outside of phpunit

    XMLWordPrintable

Details

    Description

      It looks like the phpunit check is incomplete in lock destructor. While testing MDL-46210 my normal (non-unittest) cron run failed where it should not have.

      https://github.com/moodle/moodle/blob/master/lib/classes/lock/lock.php#L105 should be:

      - if (!$this->released && defined('PHPUNIT_TEST')) {
      + if (!$this->released && defined('PHPUNIT_TEST') && PHPUNIT_TEST) {
      

      The lock should be released regardless of unittests

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              marina Marina Glancy
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              2 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour
                  1h