cypress-io / cypress

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

Timeout on big request response (~ 15 mb) #6385

Open jary91 opened 4 years ago

jary91 commented 4 years ago

Im not able to complete GET request because of timeout issue. Even increasing the responseTimeout isn't work. It was checked in two different environments, always with big response form the API (circa~15 mb). At the same time in POSTMAN the request is completed in 45 - 50 seconds.

Steps to reproduce the issue:

  1. Generate request url using heroku: https://github.com/sterenczak-marek/go-long-request
  2. Use this request url and send GET request via Cypress (code is provided below)
  3. Timeout issue is visible Zrzut ekranu 2020-02-10 o 08 04 23

the code:

describe('test', () => {
  it('get big response data', () => {
        cy.request({
            url: 'https://warm-atoll-78694.herokuapp.com/',
        })
    }); 
});

you can check it on provided url, but i'm not sure how long it will be available Version cypress 4.0

It looks like Cypress is not able to handle big response from the API.

jennifer-shehane commented 4 years ago

I was able to get the response within 43 seconds outside of Cypress. Size of response is 13.7 MB.

Cypress always times out on the request. This used to pass, so this is a regression in 3.3.2. It's not very clear from the changelog what may have caused this https://on.cypress.io/changelog#3-3-2

it('test', () => {
  cy.request({
    url: 'https://warm-atoll-78694.herokuapp.com/',
    timeout: 60000
  })
})

3.3.1

Screen Shot 2020-02-10 at 3 40 50 PM

3.3.2

Screen Shot 2020-02-10 at 3 26 32 PM

Workaround

Downgrade to Cypress 3.3.2.

vjmaiky commented 4 years ago

any updates on this topic? we saw something similar on 5.3.0

vranky commented 4 years ago

We have the same problem after downgrade to 3.3.1 our api tests works but we are shortened by new cypress features :/

zwingliernst commented 3 years ago

Same issue here, but with a POST-Request. As we had control over the expected response, we reduced the response-content to less sign (was a very long stringified JSON in the response-body) and it started working. So Cypress seems not able to consume responses of Web-Requests that exceed a certain size or body-length. Still valid for latest version.

ksuedile commented 3 years ago

with 8.3.0, same issue... cannot reduce the response body since it's the nyc global.coverage used by "fullstack coverage"

ksuedile commented 3 years ago

well, @zwingliernst seems to be right. In fact, the error message is confusing. While trying fullstack coverage, i can see the http request is responding fast enough (about 10Mb), but i get the timeout error message. I suspect the processing taking too much time. I think you should reorganize the code so that the treatment would have its own error message and not throwing a timeout error message since http seems not to be the culprit. Well, processing 10Mb of nyc backend coverage seems to be too hard to handle for cypress

anilkoithara commented 2 years ago

We have a similar kind of problem here, my GET request timed out even if I increase the time out, my response size is about 20 MB.

cy.request() timed out waiting 200000ms for a response from your server. The request we sent was: Method: GET

Surprisingly In postman this request is working fine and getting the response in 46s.

deepak2020 commented 2 years ago

Any update on the above issue?

diegorafaelgraf commented 2 years ago

In version 10.4.0 this was still happening, I upgraded to version 10.6.0 and it was fixed

engrrio07 commented 2 years ago

In version 10.8.0 this is still happening, I upgraded to version 10.10.0 and it was fixed! 🚀

cypress-app-bot commented 1 year ago

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

superkeil commented 1 year ago

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

The behavior is no more occurring since I uninstalled cypress. As for me, you can close this issue

FrancescoKrx commented 5 months ago

Hi, I have this problem in may 2024: Cypress timeout and freeze on a request with big sized response ( an over 100 mb json).

LetsCodeANewWorld commented 3 months ago

@FrancescoKrx did you manage to get it sorted? I'm facing the same challenge: it is timing out when the file size is large (40/90 mb).

cc: @jennifer-shehane any suggestion/workaround ?

phipag commented 1 month ago

I can confirm this issue is still happening in cypress 12.17.4. It works when running locally but times out when deployed in a Docker container.