Details

    • Testing Instructions:
      Hide

      Part A

      Put the attached file (testlock.php) in your moodle root.
      Open 2 different browsers (not just windows of same browser) and load the testlock.php page in each.
      When refreshed simultaneously - one window should get a lock and either hold it for 6 seconds, or exit without releasing the lock, the other window should either timeout after 3 seconds (if the first window held the lock) or get a lock as soon as the first window finishes.

      Test this a few times and make sure both windows do not get a lock at the same time, and all attempts to get a lock either timeout after 3 seconds or succeed within that time. Also make sure that locks are auto-released at the end of the request always.

      Part B

      With Mysql as the DB and no setting for $CFG->lock_factory in config.php,

      Repeat Part A

      With Postgres as the DB and no setting for $CFG->lock_factory in config.php,

      Repeat Part A

      Set in config.php
      $CFG->lock_factory = '\core\lock\db_row_lock_factory';

      Repeat Part A

      Set in config.php
      $CFG->lock_factory = '\core\lock\file_lock_factory';

      Repeat Part A

      Run unit tests on mysql. (Just lib/tests/lock_test.php and lib/tests/lock_config_test.php)

      Run unit tests on postgres. (Just lib/tests/lock_test.php and lib/tests/lock_config_test.php)

      Show
      Part A Put the attached file (testlock.php) in your moodle root. Open 2 different browsers (not just windows of same browser) and load the testlock.php page in each. When refreshed simultaneously - one window should get a lock and either hold it for 6 seconds, or exit without releasing the lock, the other window should either timeout after 3 seconds (if the first window held the lock) or get a lock as soon as the first window finishes. Test this a few times and make sure both windows do not get a lock at the same time, and all attempts to get a lock either timeout after 3 seconds or succeed within that time. Also make sure that locks are auto-released at the end of the request always. Part B With Mysql as the DB and no setting for $CFG->lock_factory in config.php, Repeat Part A With Postgres as the DB and no setting for $CFG->lock_factory in config.php, Repeat Part A Set in config.php $CFG->lock_factory = '\core\lock\db_row_lock_factory'; Repeat Part A Set in config.php $CFG->lock_factory = '\core\lock\file_lock_factory'; Repeat Part A Run unit tests on mysql. (Just lib/tests/lock_test.php and lib/tests/lock_config_test.php) Run unit tests on postgres. (Just lib/tests/lock_test.php and lib/tests/lock_config_test.php)
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-25500-master

      Description

      Just that.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                15 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  12/May/14