Details

    • MOODLE_21_STABLE, MOODLE_25_STABLE
    • MOODLE_27_STABLE
    • MDL-25500-master
    • 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)

    Description

      Just that.

      Attachments

        Issue Links

          Activity

            People

              damyon Damyon Wiese
              nebgor Aparup Banerjee
              Frédéric Massart Frédéric Massart
              Sam Hemelryk Sam Hemelryk
              Andrew Lyons Andrew Lyons
              Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              16 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                12/May/14