[wp-trac] [WordPress Trac] #60288: Fix unstable query test for post tags

WordPress Trac noreply at wordpress.org
Thu Jan 18 17:37:31 UTC 2024


#60288: Fix unstable query test for post tags
------------------------------+-------------------------
 Reporter:  flixos90          |      Owner:  flixos90
     Type:  defect (bug)      |     Status:  assigned
 Priority:  normal            |  Milestone:  6.5
Component:  Build/Test Tools  |    Version:
 Severity:  normal            |   Keywords:  needs-patch
  Focuses:                    |
------------------------------+-------------------------
 The `Tests_Query_Results::test_query_tag__not_in()` test is unstable and
 thus may occasionally fail, entirely random, see for example
 https://github.com/WordPress/wordpress-
 develop/actions/runs/7573278489/job/20625142895?pr=5658.

 This is because two of the posts that are generated have the exact same
 date and time and thus their order in the query result is random.

 For the same reason, the other test methods `test_query_paged()` and
 `test_query_paged_and_posts_per_page()` in the same class are unstable as
 well.

 An easy fix for this is to use unique dates.

 It looks like this goes back to the almost 10 year old commit [30276]. :)

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60288>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list