[wp-trac] [WordPress Trac] #50466: Random PHP test failures, take 2
WordPress Trac
noreply at wordpress.org
Wed Jun 24 14:59:07 UTC 2020
#50466: Random PHP test failures, take 2
------------------------------+--------------------
Reporter: SergeyBiryukov | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 5.5
Component: Build/Test Tools | Version:
Severity: normal | Keywords:
Focuses: |
------------------------------+--------------------
Background: #48145
After [48155], there is a [https://travis-ci.com/github/WordPress
/wordpress-develop/jobs/352901691 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.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/50466>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list