fix: Improve Big Sur browser detection performance#17807
Merged
Conversation
Contributor
|
Thanks for taking the time to open a PR!
|
Contributor
|
👏 👏 👏
…Sent from my iPhone
On Aug 19, 2021, at 10:17, cypress-bot[bot] ***@***.***> wrote:
Thanks for taking the time to open a PR!
Create a Draft Pull Request if your PR is not ready for review. Mark the PR as Ready for Review when you're ready for a Cypress team member to review the PR.
Become familiar with the Code Review Checklist for guidelines on coding standards and what needs to be done before a PR can be merged.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Test summaryRun details
View run in Cypress Dashboard ➡️ Flakiness
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 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Contributor
|
Nice. Thank you! |
3 tasks
flotwig
approved these changes
Aug 19, 2021
Contributor
flotwig
left a comment
There was a problem hiding this comment.
We do what we can because we must. LGTM
Contributor
|
BTW, was not able to test this on an actual Big Sur install as part of my review, my VM is stuck on Catalina. |
Contributor
|
An upstream fix is coming: electron/electron#26143 (comment) |
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User facing changelog
Additional details
The root of the issue is this bug in Electron, which causes spawning child processes to take 300-1000ms instead of the usual <30ms when using MacOS Big Sur and Electron 12+. We spawn a child process for each binary of each browser, plus potential fallback lookups if any of the standard ones fail. This causes the browser detection on Big Sur to take upwards of 10 seconds.
We considered using the Electron patch in that issue, but it's not a perfect solution (it was reverted in libuv due to failing tests), and would require us to build Electron ourselves, which is a large amount of work and responsibility.
As a workaround, we spawn a single child process (only incurring the performance penalty once instead of N+ times), and use it to call into our browser detection code from the user's Node.js. Since it's outside Electron, it doesn't suffer from the same bug and performs quickly. This reduces the time taken for browser detection from ~10s to ~1s.
How has the user experience changed?
Users on Big Sur will see projects open much quicker.
PR Tasks
cypress-documentation?type definitions?cypress.schema.json?