diff --git a/tests/php/TestAdminNotices.php b/tests/php/TestAdminNotices.php index 6f1738608..8d831a195 100644 --- a/tests/php/TestAdminNotices.php +++ b/tests/php/TestAdminNotices.php @@ -218,6 +218,15 @@ public function testHostErrorNoticeInAdmin() { remove_all_filters( 'ep_elasticsearch_version' ); + // As we know the call will fail, let's fail faster. + add_filter( + 'ep_pre_request_args', + function ( $args ) { + $args['timeout'] = 1; + return $args; + } + ); + ElasticPress\Elasticsearch::factory()->get_elasticsearch_version( true ); ElasticPress\Screen::factory()->set_current_screen( null ); @@ -252,6 +261,15 @@ public function testHostErrorNoticeInInstall() { delete_site_option( 'ep_need_upgrade_sync', true ); delete_site_option( 'ep_feature_auto_activated_sync' ); + // As we know the call will fail, let's fail faster. + add_filter( + 'ep_pre_request_args', + function ( $args ) { + $args['timeout'] = 1; + return $args; + } + ); + ElasticPress\Elasticsearch::factory()->get_elasticsearch_version( true ); ElasticPress\Screen::factory()->set_current_screen( 'install' );