From 35e4b004f0e16addd0cfb57aeb131efcd879fe5b Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 30 Dec 2020 19:02:03 +0000 Subject: [PATCH] Tests: Disable update checks while running REST API plugin installation tests. This prevents external HTTP requests that are not required for the tests in question and may interfere with the results in case of a timeout. Follow-up to [48242], [49491]. See #51669. git-svn-id: https://develop.svn.wordpress.org/trunk@49913 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/rest-api/rest-plugins-controller.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/phpunit/tests/rest-api/rest-plugins-controller.php b/tests/phpunit/tests/rest-api/rest-plugins-controller.php index aff8ffa3eb..739f553650 100644 --- a/tests/phpunit/tests/rest-api/rest-plugins-controller.php +++ b/tests/phpunit/tests/rest-api/rest-plugins-controller.php @@ -1023,6 +1023,13 @@ class WP_REST_Plugins_Controller_Test extends WP_Test_REST_Controller_Testcase { 10, 3 ); + + // Remove upgrade hooks which are not required for plugin installation tests + // and may interfere with the results due to a timeout in external HTTP requests. + remove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 ); + remove_action( 'upgrader_process_complete', 'wp_version_check' ); + remove_action( 'upgrader_process_complete', 'wp_update_plugins' ); + remove_action( 'upgrader_process_complete', 'wp_update_themes' ); } /**