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

test_forum_get_discussions_with_groups failure

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.1.5, 3.2.2, 3.3
    • 3.1.6, 3.2.3
    • Forum, Unit tests

    Description

      We started seeing the following phpunit failure during 27 March 2017 cycle:

      /var/www/html/moodle/lib/phpunit/classes/advanced_testcase.php:80
       
      To re-run:
       vendor/bin/phpunit mod_forum_lib_testcase mod/forum/tests/lib_test.php
       
      FAILURES!
      Tests: 7802, Assertions: 109663, Failures: 1, Skipped: 53.
      

      test_forum_get_discussions_with_groups is the test that is failing. Bisect said it is 4ca2890. It actually is just a coincidence, after 4ca2890 the failing test $group1 and $group2 have group names group-999 and group-1000. $user1 is assigned to both groups, the failing test has a comment Test retrieve discussions not passing the groupid parameter. We will receive only first group discussions.

      Following forum_get_discussions -> groups_get_activity_group -> groups_get_all_groups, we see that the returned groups are ordered by name, so the first returned group is not group-999, but group-1000 because order by returns group-1000 first. Therefore the returned discussions are $group2 discussions = 1, not 2.

      Attachments

        Issue Links

          Activity

            People

              dmonllao David Monllaó
              dmonllao David Monllaó
              Andrew Lyons Andrew Lyons
              Dan Poltawski Dan Poltawski
              Dan Poltawski Dan Poltawski
              Adrian Greeve, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                8/May/17