Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Include timeouts for APIRequestContext maxRetries option #34207

Open
bkappelstrive opened this issue Jan 3, 2025 · 0 comments
Open

Comments

@bkappelstrive
Copy link

bkappelstrive commented Jan 3, 2025

🚀 Feature Request

Extend the use case of the maxRetries option on the APIRequestContext calls (which was added for Issue 30978) to include failures due to timeouts, either due to playwright's timeout option or server timeout. At the moment it only includes retries for ECONNRESET.

In my use case we are seeing random, inconsistent timeouts occur after 30s in github CI in our setup scripts against apis that should not take that long. They normally resolve after one or two restarts of the tests, but sometimes take more retries. It is an unsolved issue atm for our specific product, but the retries in playwright could help alleviate the time spent retriggering test suites.

Here is what the error looks like

Error: apiRequestContext.get: Request timed out after 30000ms
Call log:
  - → GET https://***
  -   user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/124.0.6367.29 Safari/537.36
  -   accept: */*
  -   accept-encoding: gzip,deflate,br
  -   cookie: access_token=***

Example

It should be used the same way it's used now, only with the extended use case of including timeouts as a signal to retry.

Motivation

This feature will help API automation be more reliable and shorten time spent retriggering tests.
We have already added custom retry logic to the requests in our setup, but it would be nice to have this baked into the request context in playwright.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant