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

Unit tests: Time-dependent tests fail randomly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Deferred
    • Icon: Minor Minor
    • None
    • 2.5.2
    • Unit tests
    • MOODLE_25_STABLE

      Some tests fail if they happen to run when the second changes over. This is annoying as it causes random failures.

      (It might be difficult to fix in general, but one option is to make tests allow a 1 second leeway, i.e. rather than doing, assert that $time1 == $time2, do assert that $time2 - $time1 < 2.)

      There might already be an issue for this but in case not, I'm filing one to start the ball rolling. (I did a search for the test_group_updated_event string and didn't find anything.)

      core_group_lib_testcase::test_group_updated_event
      Event legacy data does not match expected value.
      Failed asserting that two objects are equal.
      --- Expected
      +++ Actual
      @@ @@
           'timecreated' => '1379077452'
      -    'timemodified' => '1379077452'
      +    'timemodified' => '1379077453'
       )
      

      And links from Dan (inc this and others):

      http://integration.moodle.org/job/20.%20Run%20phpunit%20UnitTests%20(master)/1668/testReport/(root)/core_setuplib_testcase/test_localcachedir/

      http://integration.moodle.org/job/20.%20Run%20phpunit%20UnitTests%20(master)/1665/testReport/junit/(root)/core_group_lib_testcase/test_group_updated_event/

      http://integration.moodle.org/job/20.%20Run%20phpunit%20UnitTests%20(master)/1623/testReport/junit/(root)/core_setuplib_testcase/test_localcachedir/

      http://integration.moodle.org/job/20.%20Run%20phpunit%20UnitTests%20(master)/1605/testReport/junit/(root)/core_completionlib_testcase/test_update_state/

            Unassigned Unassigned
            quen Sam Marshall
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

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