Make WordPress Core


Ignore:
Timestamp:
01/29/2025 06:17:34 PM (3 months ago)
Author:
johnbillion
Message:

Build/Test Tools: Add a retry mechanism for tests that perform external HTTP requests.

While the skipTestOnTimeout() method will catch a timeout and prevent it from causing a test to fail, other errors such as a failed DNS lookup or HTTPS handshake can still cause a test to unnecessarily fail. This introduces a simple retry mechanism that will hopefully further reduce the flakiness of tests that perform HTTP API requests.

Fixes #62830

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/readme.php

    r58108 r59729  
    9292     */
    9393    public function get_response_body( $url ) {
    94         $response = wp_remote_get( $url );
     94        $response = $this->wp_remote_get( $url );
    9595
    96         $this->skipTestOnTimeout( $response );
    9796        $this->assertNotWPError( $response );
    9897
Note: See TracChangeset for help on using the changeset viewer.