Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-21002

SearchHandlerTest should not rely on a specific result order

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: High High
    • None
    • 5.2-dev
    • Test framework

    Description

      Happens in 5.2-dev, but haven't checked exactly in which version it started.

      When running SearchHandlerTest, some failures are due to the order in which results are returned. Tests should be independent of the order.

      $ phpunit -d memory_limit=-1 --filter SearchHandlerTest
      PHPUnit 3.7.20 by Sebastian Bergmann.
      
      Configuration read from phpunit.xml
      
      ..............SS............................F.......FF..F
      
      Time: 4 seconds, Memory: 192.00Mb
      
      There were 4 failures:
      
      1) eZ\Publish\Core\Persistence\Legacy\Tests\Content\SearchHandlerTest::testFieldFilterIn
      Failed asserting that two arrays are equal.
      --- Expected
      +++ Actual
      @@ @@
       Array (
      -    0 => 11
      -    1 => 42
      +    0 => 42
      +    1 => 11
       )
      
      eZ/Publish/Core/Persistence/Legacy/Tests/Content/SearchHandlerTest.php:1295
      
      2) eZ\Publish\Core\Persistence\Legacy\Tests\Content\SearchHandlerTest::testObjectStateIdFilter
      Failed asserting that two arrays are equal.
      --- Expected
      +++ Actual
      @@ @@
       Array (
           0 => 4
      -    1 => 10
      -    2 => 11
      -    3 => 12
      -    4 => 13
      -    5 => 14
      -    6 => 41
      -    7 => 42
      -    8 => 45
      -    9 => 49
      +    1 => 12
      +    2 => 13
      +    3 => 41
      +    4 => 42
      +    5 => 10
      +    6 => 45
      +    7 => 49
      +    8 => 50
      +    9 => 51
       )
      
      eZ/Publish/Core/Persistence/Legacy/Tests/Content/SearchHandlerTest.php:1577
      
      3) eZ\Publish\Core\Persistence\Legacy\Tests\Content\SearchHandlerTest::testObjectStateIdFilterIn
      Failed asserting that two arrays are equal.
      --- Expected
      +++ Actual
      @@ @@
       Array (
           0 => 4
      -    1 => 10
      -    2 => 11
      -    3 => 12
      -    4 => 13
      -    5 => 14
      -    6 => 41
      -    7 => 42
      -    8 => 45
      -    9 => 49
      +    1 => 12
      +    2 => 13
      +    3 => 41
      +    4 => 42
      +    5 => 10
      +    6 => 45
      +    7 => 49
      +    8 => 50
      +    9 => 51
       )
      
      eZ/Publish/Core/Persistence/Legacy/Tests/Content/SearchHandlerTest.php:1609
      
      4) eZ\Publish\Core\Persistence\Legacy\Tests\Content\SearchHandlerTest::testVisibilityFilter
      Failed asserting that two arrays are equal.
      --- Expected
      +++ Actual
      @@ @@
       Array (
           0 => 4
      -    1 => 10
      -    2 => 11
      -    3 => 12
      -    4 => 13
      -    5 => 14
      -    6 => 41
      -    7 => 42
      -    8 => 45
      -    9 => 49
      +    1 => 12
      +    2 => 13
      +    3 => 41
      +    4 => 42
      +    5 => 10
      +    6 => 45
      +    7 => 49
      +    8 => 50
      +    9 => 51
       )
      
      eZ/Publish/Core/Persistence/Legacy/Tests/Content/SearchHandlerTest.php:1711
      
      FAILURES!
      Tests: 57, Assertions: 133, Failures: 4, Skipped: 2.
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            patrick.allaert-obsolete@ez.no Patrick Allaert (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: