[wp-trac] [WordPress Trac] #31130: WP_INSTALLING causes leakage between unit tests

WordPress Trac noreply at wordpress.org
Wed Sep 30 13:08:52 UTC 2015


#31130: WP_INSTALLING causes leakage between unit tests
------------------------------------+-----------------------------
 Reporter:  boonebgorges            |       Owner:
     Type:  defect (bug)            |      Status:  new
 Priority:  normal                  |   Milestone:  Future Release
Component:  Build/Test Tools        |     Version:
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |     Focuses:
------------------------------------+-----------------------------

Comment (by boonebgorges):

 In [changeset:"34719"]:
 {{{
 #!CommitTicketReference repository="" revision="34719"
 Prevent Multisite term tests from hitting database for 'db_version'.

 [34718] introduced a 'db_version' check to term meta functions, to ensure
 that
 they don't run when the term meta schema is not yet in place. This call to
 `get_option()` causes a database hit during Multisite tests, due to the
 presence of the `WP_INSTALLING` constant. See #31130. The extra database
 queries are causing cache tests to fail.

 In similar cases, we have `markTestSkipped()` when `is_multisite()`.
 Because
 the term meta API is so extensive - term meta caches can be primed
 anywhere a
 `WP_Query` loop is fired up - we implement a more generous workaround in
 this
 case. To prevent `get_option( 'db_version' )` from hitting the database
 during
 multisite unit tests, we use a 'pre_option_' filter.

 Heaven help us.

 See #34091.
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31130#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list