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

              Assignee:
              Unassigned
              Reporter:
              marina Marina Glancy
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              2 Vote for this issue
              Watchers:
              12 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