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

Unit test: time-based failure in test_complete_user_login

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 2.6.3
    • 2.6.2
    • Unit tests
    • MOODLE_26_STABLE
    • MOODLE_26_STABLE
    • MDL-44941-master
    • 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

      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.

            fred Frédéric Massart
            quen Sam Marshall
            Marina Glancy Marina Glancy
            Dan Poltawski Dan Poltawski
            Dan Poltawski Dan Poltawski
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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