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

Random phpunit failure with test_completion_daily_cron

XMLWordPrintable

    • MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE
    • MOODLE_310_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
    • MDL-69256-master
    • Hide

      Unit test tested by CI

      If you want to deliberately invoke this failure then you can do so by adding a sleep in after $now = time(); in the test file. A 60 second sleep will guarantee the failure before the patch, but not after the patch.

      Show
      Unit test tested by CI If you want to deliberately invoke this failure then you can do so by adding a sleep in after $now = time(); in the test file. A 60 second sleep will guarantee the failure before the patch, but not after the patch.

      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
      

            dobedobedoh Andrew Lyons
            stronk7 Eloy Lafuente (stronk7)
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            CiBoT CiBoT
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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

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