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

Midnight failure in test_statslib_cron_daily

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.7.1, 2.8
    • Fix Version/s: BACKEND
    • Component/s: Reports, Unit tests
    • Labels:
    • Affected Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE
    • Epic Link:

      Description

      Happens on ci server sometimes:

      The difference is in timestamps, they correspond to:
      09/08/2014 00:00:00 (expected)
      and
      10/08/2014 00:00:00 (actual)

      There was 1 failure:
       
      1) core_statslib_testcase::test_statslib_cron_daily with data set #0 (
      +----------------------+----------------------+----------------------+----------------------+
      | log                                                                                       |
      +----------------------+----------------------+----------------------+----------------------+
      |         time         |        userid        |        course        |        action        |
      +----------------------+----------------------+----------------------+----------------------+
       
      , 
      +----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+
      | stats_daily                                                                                                                             |
      +----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+
      |       courseid       |       timeend        |        roleid        |       stattype       |        stat1         |        stat2         |
      +----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+
      |          2           |      1407542400      |          5           |      enrolments      |          1           |          0           |
      +----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+
       
       
      +----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+
      | stats_user_daily                                                                                                                                               |
      +----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+
      |       courseid       |        userid        |        roleid        |       timeend        |      statsreads      |     statswrites      |       stattype       |
      +----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+
       
      )
      Expected log array (
        'courseid' => '2',
        'timeend' => 1407542400,
        'roleid' => '5',
        'stattype' => 'enrolments',
        'stat1' => '1',
        'stat2' => '0',
      ) was not found in stats_daily array (
        1 => 
        stdClass::__set_state(array(
           'id' => '1',
           'courseid' => '2',
           'timeend' => '1407628800',
           'roleid' => '5',
           'stattype' => 'enrolments',
           'stat1' => '1',
           'stat2' => '0',
        )),
      )
      Failed asserting that 0 is greater than 0.
       
      /var/lib/jenkins/git_repositories/MOODLE_27_STABLE/lib/tests/statslib_test.php:288
      /var/lib/jenkins/git_repositories/MOODLE_27_STABLE/lib/tests/statslib_test.php:705
      /var/lib/jenkins/git_repositories/MOODLE_27_STABLE/lib/phpunit/classes/advanced_testcase.php:80
       
      To re-run:
       /var/lib/jenkins/composer_base/MOODLE_27_STABLE/vendor/bin/phpunit core_statslib_testcase lib/tests/statslib_test.php
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                2 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated: