Skip to content

Conversation

@ryanthemanuel
Copy link
Collaborator

User facing changelog

The Cypress App will no longer crash when proxying an ill formed request. For example, if the application under test has a resource of "http: //localhost/asset.js" (notice the extraneous space) the Cypress App will no longer crash. Instead, a debug message will be logged and the asset will fail to load.

Additional details

The goal here is to treat these ill-formed requests just like any other requests that are problematic (e.g. not found resources). Thus, we don't attempt to stop the tests outright, but instead just fail the individual request.

How has the user experience changed?

Before:

Terminal:

image

After:

Terminal:

image

Browser Console:

image

Network:

image

PR Tasks

  • Have tests been added/updated?
  • [na] Has the original issue (or this PR, if no issue exists) been tagged with a release in ZenHub? (user-facing changes only)
  • [na] Has a PR for user-facing changes been opened in cypress-documentation?
  • [na] Have API changes been updated in the type definitions?
  • [na] Have new configuration options been added to the cypress.schema.json?

@ryanthemanuel ryanthemanuel requested a review from a team as a code owner December 2, 2021 02:13
@ryanthemanuel ryanthemanuel requested review from jennifer-shehane and removed request for a team December 2, 2021 02:13
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Dec 2, 2021

Thanks for taking the time to open a PR!

@ryanthemanuel ryanthemanuel changed the base branch from develop to 10.0-release December 2, 2021 02:40
@cypress
Copy link

cypress bot commented Dec 2, 2021



Test summary

18146 1 202 0Flakiness 3


Run details

Project cypress
Status Failed
Commit 1051fcd
Started Dec 6, 2021 5:52 PM
Ended Dec 6, 2021 6:04 PM
Duration 11:35 💡
OS Linux Debian - 10.10
Browser Multiple

View run in Cypress Dashboard ➡️


Failures

cypress/integration/commands/net_stubbing_spec.ts Failed
1 network stubbing > intercepting request > should delay the same amount on every response

Flakiness

commands/net_stubbing_spec.ts Flakiness
1 network stubbing > waiting and aliasing > can timeout waiting on a single request using "alias.request"
2 network stubbing > waiting and aliasing > can timeout waiting on a single request using "alias.request"
cypress/proxy-logging-spec.ts Flakiness
1 ... > works with forceNetworkError

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@jennifer-shehane jennifer-shehane removed their request for review December 2, 2021 04:20
Copy link
Contributor

@flotwig flotwig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix is good, but could you also add some error handling around the addContext call itself? It shouldn't crash the process if it fails. In fact, I don't really see why the promise chain isn't catching the error, is it an unhandled rejection or is there no .on('error' handler on the HTTPS server so this error crashes the process?

@ryanthemanuel
Copy link
Collaborator Author

@flotwig I have made the requested changes

@ryanthemanuel ryanthemanuel requested a review from flotwig December 3, 2021 22:39
Copy link
Contributor

@flotwig flotwig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Very nice 👍

@ryanthemanuel ryanthemanuel merged commit 929bf3d into 10.0-release Dec 6, 2021
@ryanthemanuel ryanthemanuel deleted the issue-9220-fix-issue-with-blank-url-in-proxy branch December 6, 2021 18:13
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

Successfully merging this pull request may close these issues.

SIGSEGV with ERR_TLS_REQUIRED_SERVER_NAME in Server.addContext

4 participants