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

core_files_externallib_testcase::test_get_files sporadically fails

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6
    • Fix Version/s: 2.6
    • Component/s: Unit tests
    • Labels:
    • Story Points:
      2
    • Sprint:
      BACKEND Sprint 4

      Description

      This test keeps failing on the integration server because of minor time differences.

      1. Ideally you would change the test so it doesn't depend on us having the two evaluations happen within 1 second of each other because that often leads to failures.
      2. But also, your test data is wrong, its passing because php sucks, but as this diff below shows:
        1. 'itemid' => 1 should be 'itemid' => '1'
        2. 'isdir' => null should be 'isdir' => false

      Output:

      core_files_externallib_testcase::test_get_files
      Failed asserting that two arrays are equal.
      --- Expected
      +++ Actual
      @@ @@
                   'filearea' => 'content'
      -            'itemid' => '1'
      +            'itemid' => 1
                   'filepath' => '/'
                   'filename' => 'Simple4.txt'
                   'url' => 'http://www.example.com/moodle...e4.txt'
      -            'isdir' => false
      -            'timemodified' => '1377497719'
      +            'isdir' => null
      +            'timemodified' => '1377497718'
               )
           )
       )
       
      /var/lib/jenkins/git_repositories/master/files/tests/externallib_test.php:285
      /var/lib/jenkins/git_repositories/master/lib/phpunit/classes/advanced_testcase.php:76
      

      http://integration.moodle.org/job/20.%20Run%20phpunit%20UnitTests%20(master)/1551/testReport/junit/(root)/core_files_externallib_testcase/test_get_files/

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              abgreeve Adrian Greeve
              Reporter:
              poltawski Dan Poltawski
              Integrator:
              Dan Poltawski
              Tester:
              Dan Poltawski
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                18/Nov/13