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

Cypress error being appended to JSON strings for network requests. #1027

Closed
wichopy opened this issue Dec 6, 2017 · 1 comment
Closed

Cypress error being appended to JSON strings for network requests. #1027

wichopy opened this issue Dec 6, 2017 · 1 comment

Comments

@wichopy
Copy link

wichopy commented Dec 6, 2017

  • Operating System: Mac OSX High Sierra 10.13.1
  • Cypress Version:
  • Browser Version: Electron 53

Is this a Feature or Bug?

Bug

Current behavior:

After extended use with Cypress, HTTP requests start getting a cypress error appended to my JSON responses.

Additional Info (images, stack traces, etc)

Inspecting the network requests while tests run, I can see the correct data being returned from axios. Console logging the data however shows the following text appended to the JSON data which breaks all my tests:

<!DOCTYPE html>\n<html>\n<body>\n Cypress errored attempting to make an http request to this url:<br /><br />http://localhost:8081/server/fhir/Questionnaire/crf/<br /><br /><br />The error was:<br /><br />read ECONNRESET<br /><br /><br />The stack trace was:<br /><br />Error: read ECONNRESET<br /> at exports._errnoException (util.js:1026:11)<br /> at TCP.onread (net.js:564:26)<br />\n</body>\n</html>

I used postman to see if something is wrong with the local server and my requests are working fine. Also, no error logs coming out of the server.

To get Cypress running again I need to restart my computer.

I tried switching to our dev server and the tests work again, but I like using local while developing as the dev server goes down whenever new pushes are made. It's running Apache tomcat.

Hope someone has some insight on to why this error is happening, its super weird.

@jennifer-shehane jennifer-shehane added the stage: needs investigating Someone from Cypress needs to look at this label Dec 7, 2017
@brian-mann
Copy link
Member

What's happening is that your server is terminating the connection whilst the streaming response is in flight and before the final connection close packet is received.

This ends up causing the Cypress proxy to error, which then injects its own response body on top of the stream.

This is a pretty rare edge case, but I opened an issue with the root cause, so I'm closing this one in favor of that: #1036

@jennifer-shehane jennifer-shehane removed stage: needs investigating Someone from Cypress needs to look at this labels Jan 16, 2019
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

3 participants