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

Unreleased lock throws exception outside of phpunit

XMLWordPrintable

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

      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

            Votes:
            2 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved:

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

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