-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
proxy mishandles network errors #1013
Comments
Can you provide a reproducible example? The reason I ask is that given the description, I know that there must be more to this problem. The Cypress proxy most definitely works as intended in these scenarios. A very simple and quick test results in the immediate returning of those network requests in the case of ECONNREFUSED. Here's both an image and an XHR failing as intended. Timings: Timings: |
This can be tested by opening a second tab in the cypress-controlled browser, and loading this file (making sure nothing is listening on port 1234). <html><body><script>
window.onload = function () {
console.log('hello');
var xhr = new XMLHttpRequest();
// This case should return connection refused, but instead returns server 500.
// xhr.open('GET', 'http://localhost:1234/');
// This case should return connection refused, but hangs for 30s and returns timeout.
xhr.open('GET', 'https://localhost:1234/');
xhr.onreadystatechange = function() {
console.log('got status', xhr.status);
};
xhr.send();
}
</script></body></html> |
Also, verified same behavior on OSX 10.10 with chrome 62. |
The code for this is done in cypress-io/cypress#4015, but has yet to be released. |
Released in |
Current behavior:
Connection refused errors, that should fail in a fraction of a second, are instead returned as timeouts, after 30s.
Desired behavior:
Return error 'connection refused' on connection refused, at the time the connection is refused.
How to reproduce:
In the test app, make an ajax request to port that isn't listening. Outside cypress, it should fail immediately with connection refused. In cypress, it will fail after half a minute with timeout.
Additional Info (images, stack traces, etc)
The text was updated successfully, but these errors were encountered: