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

Failing unit test on Redis 4.0

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Run a redis server:

        docker run -d -p 6379:6379 --name redis redis
        

      2. Add redis configuration to config.php:

        $redistestname = '127.0.0.1';
        define('TEST_SESSION_REDIS_HOST', $redistestname);
        define('TEST_CACHESTORE_REDIS_TESTSERVERS', $redistestname);
        

      3. Install redis 3.1.6:

        pecl install redis-3.1.6
        

      4. Run phpunit tests for redis:

        ./vendor/bin/phpunit lib/tests/session_redis_test.php
        ./vendor/bin/phpunit cache/stores/redis/tests/redis_test.php
        

        1. Verify no failure
      5. Upgrade to Redis 4.1.0

        pecl install redis-4.1.0
        

      6. Run phpunit tests for redis:

        ./vendor/bin/phpunit lib/tests/session_redis_test.php
        ./vendor/bin/phpunit cache/stores/redis/tests/redis_test.php
        

        1. Verify no failure
      Show
      Run a redis server: docker run -d -p 6379:6379 --name redis redis Add redis configuration to config.php: $redistestname = '127.0.0.1'; define('TEST_SESSION_REDIS_HOST', $redistestname); define('TEST_CACHESTORE_REDIS_TESTSERVERS', $redistestname); Install redis 3.1.6: pecl install redis-3.1.6 Run phpunit tests for redis: ./vendor/bin/phpunit lib/tests/session_redis_test.php ./vendor/bin/phpunit cache/stores/redis/tests/redis_test.php Verify no failure Upgrade to Redis 4.1.0 pecl install redis-4.1.0 Run phpunit tests for redis: ./vendor/bin/phpunit lib/tests/session_redis_test.php ./vendor/bin/phpunit cache/stores/redis/tests/redis_test.php Verify no failure
    • Affected Branches:
      MOODLE_31_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE
    • Fixed Branches:
      MOODLE_31_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE
    • Pull 3.5 Branch:
    • Pull Master Branch:
      MDL-63050-master

      Description

      PHP Redis 4.0 introduced a change whereby the exists function returns a count, rather than a bool.

      We need to update the session_exists function accordingly.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dobedobedoh Andrew Nicols
              Reporter:
              dobedobedoh Andrew Nicols
              Peer reviewer:
              Eloy Lafuente (stronk7)
              Integrator:
              Jake Dallimore
              Tester:
              Víctor Déniz Falcón
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                10/Sep/18