cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
46.72k stars 3.16k forks source link

Test Replay: [Upload] Update timeout logic to fail faster on catastrophic timeouts #28890

Closed ryanthemanuel closed 5 months ago

ryanthemanuel commented 7 months ago

What would you like?

Currently, the logic for timing out on uploading test replay data is set at 2 minutes. We also have retrying logic that attempts to retry 8 times on failures. This ends up being over 16 minutes of waiting if the upload URL will never be reachable. To resolve this, I propose:

More context:

Why is this needed?

No response

Other

No response

cacieprins commented 6 months ago

I think we can simplify this a little - copying what @cypress/request does may not be the best course.

cypress/request connection timeouts have a maximum of the OS-wide TCP connection timeout. Increasing this won't have any effect, and reducing this would probably only cause a higher error rate. I'd prefer to keep this at the OS-specified value; extending @packages/network Agent will be expensive to implement, and likely won't have a high rate of return.

Status code available sent is only important in error cases I think, which will simply reject the promise.

Data flowing is a great metric for timing out an upload, because it's what's important to the success of the upload.

I suggest:

What do you think?