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

Unit test: time-based failure in test_complete_user_login

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.6.2
    • Fix Version/s: 2.6.3
    • Component/s: Unit tests
    • Labels:
    • Testing Instructions:
      Hide
      1. Run the tests in core_moodlelib_testcase
      2. Hack lib/tests/moodlelib_test.php::test_complete_user_login()
        • Add sleep(5) after $this->getDataGenerator()->create_user();
      3. Run the tests in core_moodlelib_testcase
      4. You should not see any failures during the test
      Show
      Run the tests in core_moodlelib_testcase Hack lib/tests/moodlelib_test.php::test_complete_user_login() Add sleep(5) after $this->getDataGenerator()->create_user(); Run the tests in core_moodlelib_testcase You should not see any failures during the test
    • Affected Branches:
      MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-44941-master

      Description

      I saw this (only once) when running tests on latest master on Windows 7:

      <pre>
      2) core_moodlelib_testcase::test_complete_user_login
      Time is lower that allowed start value
      Failed asserting that '1396532431' is equal to 1396532432 or is greater than 1396532432.

      C:\Users\sm449\workspace\core-moodle-github\lib\phpunit\classes\advanced_testcase.php:396
      C:\Users\sm449\workspace\core-moodle-github\lib\tests\moodlelib_test.php:2467
      C:\Users\sm449\workspace\core-moodle-github\lib\phpunit\classes\advanced_testcase.php:80

      To re-run:
      c:/users/sm449/workspace/core-moodle-github/vendor/phpunit/phpunit/composer/bin/phpunit core_moodlelib_testcase C:\Users\sm449\workspace\core-moodle-github\lib\tests\moodlelib_test.php
      </pre>

      Looks like a rare time error, sorry I didn't have time to code a fix just now, but thought I'd report it at least.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              fred Frédéric Massart
              Reporter:
              quen Sam Marshall
              Peer reviewer:
              Marina Glancy
              Integrator:
              Dan Poltawski
              Tester:
              Dan Poltawski
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

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