#50466 closed defect (bug) (fixed)
Random PHP test failures, take 2
| Reported by: | SergeyBiryukov | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.5 |
| Component: | Build/Test Tools | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
Background: #48145
After [48155], there is a test failure on Travis that appears to be unrelated to the commit:
1) Tests_List_Pages::test_wp_list_pages_sort_column Failed asserting that two strings are equal. --- Expected +++ Actual @@ @@ <li class="page_item page-item-1802"><a href="http://example.org/?page_id=1802">Child 3</a></li>\n </ul>\n </li>\n +<li class="page_item page-item-1792 page_item_has_children"><a href="http://example.org/?page_id=1792">Parent 2</a>\n +<ul class='children'>\n + <li class="page_item page-item-1797"><a href="http://example.org/?page_id=1797">Child 1</a></li>\n + <li class="page_item page-item-1798"><a href="http://example.org/?page_id=1798">Child 2</a></li>\n + <li class="page_item page-item-1799"><a href="http://example.org/?page_id=1799">Child 3</a></li>\n +</ul>\n +</li>\n <li class="page_item page-item-1791 page_item_has_children"><a href="http://example.org/?page_id=1791">Parent 1</a>\n <ul class='children'>\n <li class="page_item page-item-1794"><a href="http://example.org/?page_id=1794">Child 1</a></li>\n <li class="page_item page-item-1795"><a href="http://example.org/?page_id=1795">Child 2</a></li>\n <li class="page_item page-item-1796"><a href="http://example.org/?page_id=1796">Child 3</a></li>\n -</ul>\n -</li>\n -<li class="page_item page-item-1792 page_item_has_children"><a href="http://example.org/?page_id=1792">Parent 2</a>\n -<ul class='children'>\n - <li class="page_item page-item-1797"><a href="http://example.org/?page_id=1797">Child 1</a></li>\n - <li class="page_item page-item-1798"><a href="http://example.org/?page_id=1798">Child 2</a></li>\n - <li class="page_item page-item-1799"><a href="http://example.org/?page_id=1799">Child 3</a></li>\n </ul>\n </li>\n </ul></li>' /var/www/tests/phpunit/includes/abstract-testcase.php:668 /var/www/tests/phpunit/tests/post/listPages.php:330
Looks like it's caused by indeterminate sort ordering in test_wp_list_pages_sort_column() when trying to sort these pages by post_author in descending order:
- Parent 3:
post_author: 2 - Parent 1:
post_author: 0 - Parent 2:
post_author: 0
By adding an author to Parent 1 too we can make sure the test works as expected.
Change History (4)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
In 48157: