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

Random unittest faillure in test_file_is_draft_areas_limit_reached

    XMLWordPrintable

Details

    • 1
    • Team Omega 4.1 Sprint 0.2, Team Omega 4.1 Sprint 0.3

    Description

      We have seen a random unittest failure on Oracle (slow DB):

      core_filelib_testcase::test_file_is_draft_areas_limit_reached
      Failed asserting that false is true.
       
      /var/www/html/lib/tests/filelib_test.php:1728
      /var/www/html/lib/phpunit/classes/advanced_testcase.php:80
      

      It can be reproduced by adding a "sleep(1)":

      diff --git a/lib/tests/filelib_test.php b/lib/tests/filelib_test.php
      index b66a2481273..5306fc03e5d 100644
      --- a/lib/tests/filelib_test.php
      +++ b/lib/tests/filelib_test.php
      @@ -1721,6 +1721,7 @@ EOF;
               $this->assertFalse(file_is_draft_areas_limit_reached($user->id));
       
               // Only one item was leaked from the bucket. So the bucket should become full again if we add a single item to it.
      +        sleep(1);
               self::create_draft_file([
                   'filename' => 'file2.png',
                   'itemid' => $itemids[0],
      

      The test looks fragile and time-sensitive

      Attachments

        Activity

          People

            lameze Simey Lameze
            marina Marina Glancy
            Paul Holden Paul Holden
            Jun Pataleta Jun Pataleta
            CiBoT CiBoT
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              12/Sep/22

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 6 hours, 50 minutes
                1d 6h 50m