cypress: getting random http response code 500

Current behavior & Steps to reproduce:

This works as expected:

cy.visit('http://localhost:8080/ui/st.bquadro/agent');
cy.get('.login-content input[type=text]')
    .type('admin')
    .should('have.value', 'admin');

cy.get('.login-content input[type=password]')
    .type('xxxx')
    .should('have.value', 'xxxx');

cy.get('.login-content .submit input[name=commit]').click();

cy.visit('http://localhost:8080/ui/st.bquadro/agent#dashboard', {
    auth: { username: 'admin', password: 'xxxx' }
});

but this gives some network errors (status code 500):

cy.visit('http://localhost:8080/ui/st.bquadro/agent#dashboard', {
    auth: { username: 'admin', password: 'xxxx' }
});

i’ve run our application with a debugger, and i’m almost sure our web server is not returning an error but a 200 OK.

the requests that fails are not always the same: image but one of four files, just one of them succeeds. i’ve run cypress in debug mode and

Desired behavior:

test should not throw random 500.

Versions

windows 10 pro + chrome + cypress 3.0.2

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 2
  • Comments: 29 (7 by maintainers)

Most upvoted comments

I have the same problem running my tests. It mostly occurs after a few longer tests have been run (in Gitlab CI). At some point cy.visit() will return a 500 error.

This randomly happens to us as well: cypress-random-500-error

We’ve never experienced those 500 errors while using the site we’re testing or running the tests locally. It only happens on the CI server.

I strongly advice against brushing this issue under the rug. This is obviously not an isolated case, as there’re many who report the same issue, in this and other threads. I think this is also tied to https://github.com/cypress-io/cypress/issues/1039 , https://github.com/cypress-io/cypress/issues/2938 and https://github.com/cypress-io/cypress/issues/2639 . It has to have something to do with the way cypress channels the requests through.

If not solved, this will occur for future users and Cypress can not become a reliable solution for testing large platforms.

Unfortunately we’ll have to close this issue if no reproducible example is provided. Can anyone provide a way to reproduce this?