[wp-trac] [WordPress Trac] #51669: Reduce misleading test failures caused by HTTP timeouts, take 2

WordPress Trac noreply at wordpress.org
Mon Nov 23 20:16:33 UTC 2020


#51669: Reduce misleading test failures caused by HTTP timeouts, take 2
------------------------------+-----------------------------
 Reporter:  SergeyBiryukov    |       Owner:  SergeyBiryukov
     Type:  defect (bug)      |      Status:  accepted
 Priority:  normal            |   Milestone:  5.7
Component:  Build/Test Tools  |     Version:
 Severity:  normal            |  Resolution:
 Keywords:                    |     Focuses:
------------------------------+-----------------------------

Old description:

> 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’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".
> }}}
>
> 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.

New description:

 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’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’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.

--

Comment (by SergeyBiryukov):

 Just noting that failures/errors in `WP_REST_Plugins_Controller_Test` also
 occasionally happen on trunk too, as seen in [https://github.com/WordPress
 /wordpress-develop/runs/1444055826 this run on GitHub Actions] for
 example.

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


More information about the wp-trac mailing list