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

Unreleased lock throws exception outside of phpunit

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Won't Do
    • 2.7.2, 2.8.1, 3.0.3, 3.3, 3.5.5, 3.6.3
    • None
    • Tasks

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

                Time Tracking

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