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

Random DB ordering related failure in question externallib

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 4.0.3
    • 4.0.2
    • Questions
    • MOODLE_400_STABLE
    • MOODLE_400_STABLE
    • Hide

      Covered by unit tests, hard to reproduce the original failure - ensure repeated runs of test pass, e.g.:

      $ bin/moodle-docker-compose exec webserver vendor/bin/phpunit --repeat 100 question/tests/externallib_test.php --filter test_get_random_question_summaries_with_limit_and_offset
      

      Show
      Covered by unit tests, hard to reproduce the original failure - ensure repeated runs of test pass, e.g.: $ bin/moodle-docker-compose exec webserver vendor/bin/phpunit --repeat 100 question/tests/externallib_test.php --filter test_get_random_question_summaries_with_limit_and_offset

      From internal CI, reference:

      Regression
       
      core_question.externallib_test.test_get_random_question_summaries_with_limit_and_offset (from core_question_externallib_test)
      Failing for the past 1 build (Since
      #118 )
      Took 0.14 sec.
      Stacktrace
       
      core_question\externallib_test::test_get_random_question_summaries_with_limit_and_offset
      Failed asserting that '158003' matches expected 158000.
       
      /var/www/html/question/tests/externallib_test.php:405
      /var/www/html/lib/phpunit/classes/advanced_testcase.php:80
      

      Looking at the test in question, it appears to be asserting supposed ordering on returned DB records (via $limit and $offset arguments) on a query that doesn't specify any ordering (hence sporadic failures when database decides to return data in unexpected order)

      Looking at history of that class, appears to be a regression from MDL-71516, as the 311 version does still have the predictable ordering in the database query

            pholden Paul Holden
            pholden Paul Holden
            Safat Shahin Safat Shahin
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            CiBoT CiBoT
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 7 minutes
                1h 7m

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