Skip to content

Commit

Permalink
Merge pull request #4047 from 10up/chore/speed-up-unit-tests
Browse files Browse the repository at this point in the history
Unit Tests: Fail faster on requests we know will fail
  • Loading branch information
felipeelia authored Dec 11, 2024
2 parents 48ccfa2 + cb1b6db commit b125998
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/php/TestAdminNotices.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down Expand Up @@ -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' );
Expand Down

0 comments on commit b125998

Please sign in to comment.