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

Unreleased lock throws exception outside of phpunit

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Minor
    • None
    • 2.7.2, 2.8.1, 3.0.3, 3.3, 3.5.5, 3.6.3
    • 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

              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

                  Clockify

                    Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.