Retry API calls that fail due to unexpected transient exceptions like timeouts and connection errors
Some test failures are due to transient network-related errors. For example: https://ops.gitlab.net/gitlab-org/quality/staging/-/jobs/1063921
Failure/Error: post create_project_request.url, path: project_name, name: project_name, namespace_id: @group_id Errno::ECONNRESET:Connection reset by peer - SSL_connect
In most cases the test will automatically retry, but if won't if the failure occurs in a before(:context)
hook, as in that example.
Regardless, it could be more efficient if the framework could retry the action that failed, rather than the entire test. This could be difficult with UI actions that are not necessarily idempotent, but it could be more straightforward with API calls.
Proposal
Update the E2E framework to automatically retry API calls that fail due to timeouts or network-related errors that are likely to be transient.