WordPress.org

Make WordPress Core

Opened 4 weeks ago

Last modified 3 days ago

#51669 accepted defect (bug)

Reduce misleading test failures caused by HTTP timeouts, take 2

Reported by: SergeyBiryukov Owned by: SergeyBiryukov
Milestone: 5.7 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords:
Focuses: Cc:

Description (last modified by SergeyBiryukov)

Background: #44613.

During the 5.5.2 release and subsequent backports all the way to the 3.7 branch, there were quite a few test failures caused by HTTP timeouts. Some examples of these, collected by @desrosj:

1) Tests_HTTP_curl::test_redirect_on_head
Connection timed out after 5001 milliseconds
Failed asserting that WP_Error Object (...) is not an instance of class "WP_Error".

1) Tests_HTTP_curl::test_redirect_on_head
Failed asserting that true is false.

1) Tests_HTTP_curl::test_redirect_on_302
Failed asserting that true is false.

1) Tests_HTTP_Functions::test_get_response_cookies
Failed asserting that an array is not empty.

1) Tests_HTTP_streams::test_redirect_on_301
stream_socket_client(): unable to connect to tcp://api.wordpress.org:80 (Connection timed out)

1) Tests_HTTP_streams::test_no_head_redirections
cURL error 28: Connection timed out after 5000 milliseconds
Failed asserting that WP_Error Object (...) is not an instance of class "WP_Error".

These are already fixed in 4.9 or later branches by [43511], [43512], [46682], and [46996]. These changes should be backported to earlier branches too.

There were, however, some other failures in the REST API plugin controller tests:

1) WP_REST_Plugins_Controller_Test::test_create_item_and_activate_errors_if_no_permission_to_activate_plugin
An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/forums/">support forums</a>. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)

1) WP_REST_Plugins_Controller_Test::test_create_item_and_network_activate
Download failed.
Failed asserting that WP_Error Object (...) is not an instance of class "WP_Error".

1) WP_REST_Plugins_Controller_Test::test_create_item
An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/forums/">support forums</a>. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)

These tests are not in the external-http group. Looking closer, they appear to set up the plugin download to come locally instead of downloading it from WordPress.org, so it's not quite clear why they still attempt to connect to WordPress.org. This will need more investigation.

Change History (4)

#1 @SergeyBiryukov
4 weeks ago

  • Owner set to SergeyBiryukov
  • Status changed from new to accepted

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


4 weeks ago

#3 @SergeyBiryukov
10 days ago

  • Milestone changed from 5.6 to 5.7

The backports are not tied to a particular release, but the second part (plugin controller tests) needs some investigation. Moving to the next release for now.

#4 @SergeyBiryukov
3 days ago

  • Description modified (diff)

Just noting that failures/errors in WP_REST_Plugins_Controller_Test also occasionally happen on trunk too, as seen in this run on GitHub Actions for example.

Note: See TracTickets for help on using tickets.