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

test_forum_get_discussions_with_groups failure

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1.5, 3.2.2, 3.3
    • Fix Version/s: 3.1.6, 3.2.3
    • Component/s: Forum, Unit tests
    • Labels:

      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

              • Assignee:
                dmonllao David Monllaó
                Reporter:
                dmonllao David Monllaó
                Peer reviewer:
                Andrew Nicols
                Integrator:
                Dan Poltawski
                Tester:
                Dan Poltawski
                Participants:
                Component watchers:
                Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze, Andrew Nicols, Mathew May, 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:
                  8/May/17