Make WordPress Core

Opened 3 years ago

Closed 9 months ago

Last modified 9 months ago

#60831 closed defect (bug) (fixed)

Investigate flakey `Tests_Admin_wpSiteHealth ::test_object_cache_thresholds()` test

Reported by: swissspidy Owned by: peterwilsoncc
Priority: normal Milestone: 6.9.1
Component: Site Health Version:
Severity: normal Keywords: has-patch has-unit-tests
Cc: Focuses:

Description

The following two tests / datasets sometimes fail for certain hosting providers:

Tests_Admin_wpSiteHealth::test_object_cache_thresholds::test_object_cache_thresholds with data set #2

Tests_Admin_wpSiteHealth::test_object_cache_thresholds with data set #2 ('terms_count', 1)
Failed asserting that false is true.

/tmp/wp-test-runner/tests/phpunit/tests/admin/wpSiteHealth.php:482
Tests_Admin_wpSiteHealth::test_object_cache_thresholds::test_object_cache_thresholds with data set #3

Tests_Admin_wpSiteHealth::test_object_cache_thresholds with data set #3 ('options_count', 100)
Failed asserting that false is true.

/tmp/wp-test-runner/tests/phpunit/tests/admin/wpSiteHealth.php:482

Example: ​https://make.wordpress.org/hosting/test-results/r57871/digitoimistodude-r57871/

Maybe these are just issues with that particular host, but perhaps there's also a opportunity to make the tests more robust. So let's try to look into it to find out more.

Change History (10)

This ticket was mentioned in ​Slack in #core by jorbin. ​View the logs.


9 months ago

#2 @wildworks
9 months ago

I noticed that this issue is no longer occurring on trunk, I think it's related to the data provider value being changed from 100 to 1.

​https://github.com/WordPress/wordpress-develop/pull/10638/changes/0b4a0ae4d97b4645c5840b3fcdbe7016f3ab4a5e

This ticket was mentioned in ​PR #10813 on ​WordPress/wordpress-develop by ​@peterwilsoncc.


9 months ago
#3

  • Keywords has-patch has-unit-tests added

Reduces the thresholds for all options tests to be very low in order to substantially reduce the change the WordPress environment will affect the test.

Trac ticket: https://core.trac.wordpress.org/ticket/60831

This ticket was mentioned in ​PR #10814 on ​WordPress/wordpress-develop by ​@peterwilsoncc.


9 months ago
#4

Reduces the thresholds for all options tests to be very low in order to substantially reduce the change the WordPress environment will affect the test.

Includes the change committed earlier to the build tools for the options count for backporting to 6.9.

Trac ticket: https://core.trac.wordpress.org/ticket/60831

#5 @peterwilsoncc
9 months ago

I've created a pull request to reduce the targets right down to almost nothing so the threasholds are much more likely to be passed, regardless of the environment.

​PR#10813 targets trunk and reduces the alloptions count to 1 and the alloptions byte count to 10.

​PR#10814 targets the 6.9 branch and does the same with the inclusion of the change made to the options count in r61438.

I've not been able to reproduce the issue locally so unable to do a bisect to find the improvement that triggered the test threashold to be above the default config for the test suite.

This ticket was mentioned in ​Slack in #core by peterwilsoncc. ​View the logs.


9 months ago

#7 @peterwilsoncc
9 months ago

  • Milestone Awaiting Review → 6.9.1

#8 @peterwilsoncc
9 months ago

  • Owner set to peterwilsoncc
  • Resolution → fixed
  • Status new → closed

In 61562:

Site Health: Reduce thresholds for object cache threshold tests.

Reduces the object counts required for Site Health to recommend a persistent object cache in the Tests_Admin_wpSiteHealth::test_object_cache_thresholds() data provider.

This is to ensure that the number of objects (terms, posts, etc) are certainly below the defaults created by the test suite during set up. The new threasholds are:

  • terms count: 0
  • alloptions count: 1
  • alloptions bytes: 10

This follows the reduction to the options count threshold to 1 in r61438.

Props peterwilsoncc, swissspidy, wildworks.
Fixes #60831.

#9 @peterwilsoncc
9 months ago

In 61563:

Site Health: Reduce thresholds for object cache threshold tests.

Reduces the object counts required for Site Health to recommend a persistent object cache in the Tests_Admin_wpSiteHealth::test_object_cache_thresholds() data provider.

This is to ensure that the number of objects (terms, posts, etc) are certainly below the defaults created by the test suite during set up. The new threasholds are:

  • terms count: 0
  • alloptions count: 1
  • alloptions bytes: 10

This follows the reduction to the options count threshold to 1 in r61438.

Merges [61562] to the 6.9 branch; merges the one line change from [61438] to the 6.9 branch.

Props peterwilsoncc, swissspidy, wildworks.
Fixes #60831.

#10 @peterwilsoncc
9 months ago

@swissspidy I've committed changes to reduce the thresholds to ridiculously low numbers to ensure the tests pass.

I backported to the 6.9 branch as the test suite was consistently failing on some MariaDB 5.5 instances, creating much noise in Slack.

I'll keep an eye on things to see if we need to backport further but it appears to be a recent change causing the flakiness.

Note: See TracTickets for help on using tickets.