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

Random phpunit failure with test_completion_daily_cron

    XMLWordPrintable

    Details

      Description

      Reproducible specially on Oracle, on slow / busy environments.

      Case 1

      Link: https://ci.moodle.org/job/S.01.05%20-%20PHPUnit%20-%20Oracle%20(php73)/783/

      1) core\task\core_completion_cron_task_testcase::test_completion_daily_cron
      Failed asserting that two strings are equal.
      --- Expected
      +++ Actual
      @@ @@
      -'Saturday, 11 July 2020, 1:31 PM'
      +'Saturday, 11 July 2020, 1:32 PM'
       
      /var/www/html/lib/tests/completion_daily_task_test.php:121
      /var/www/html/lib/phpunit/classes/advanced_testcase.php:80
       
      To re-run:
       vendor/bin/phpunit --verbose "core\task\core_completion_cron_task_testcase" lib/tests/completion_daily_task_test.php
      

      It seems that there is a problem when the execution ends in the next minute, so the slower the execution is... the more chances of this random problem to happen.

      Have seen failures in 37_STABLE and up, but worth checking if the same problem happens in 35_STABLE or no.

      Case 2

      Less often (just a couple of times till now, but related to the same test)

      Link: https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/1467/

      1) core\task\core_completion_cron_task_testcase::test_completion_daily_cron
      Failed asserting that an array is empty.
       
      /var/www/html/lib/tests/completion_daily_task_test.php:110
      /var/www/html/lib/phpunit/classes/advanced_testcase.php:80
       
      To re-run:
       vendor/bin/phpunit --verbose "core\task\core_completion_cron_task_testcase" lib/tests/completion_daily_task_test.php
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dobedobedoh Andrew Lyons
              Reporter:
              stronk7 Eloy Lafuente (stronk7)
              Peer reviewer:
              Sara Arjona (@sarjona) Sara Arjona (@sarjona)
              Integrator:
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Tester:
              CiBoT CiBoT
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona), Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                10/May/21

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 46 minutes
                  46m