-
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
feat: Added configuration parameter that controls the amount of connection attempts to the browser #25848
Conversation
…ction attempts to the browser
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Malvitus Thanks for opening a PR.
Instead of adding a new configuration option, could you use an environment variable instead? Something like CYPRESS_BROWSER_CONNECTION_RETRIES
. Since the vast majority of users won't need to adjust this value there's no need to put it in config.
Sure, i can change it to an environment variable. Should I open a new PR then? I guess when using an environment variable, i can circumvent a lot of parameter passing and use it directly at the places that are relevant, so I would refactor my PR anyway |
…of connection attempts to the browser" This reverts commit 4fd816a.
…ction attempts to the browser
@flotwig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good @Malvitus. Can you clarify your use case on why you want to add this? Why is it taking more than a minute for your browser to open?
Co-authored-by: Matt Henkes <mjhenkes@gmail.com>
I confess that my setup is not that straight forward. For once, my server executing the tests is not that beefy, so execution of anything is not that fast (which I don't mind). The other factor is that I have different browser versions i want to use in my Cypress tests on a network share (as I don't want them to clutter the machine). So depending on the available bandwidth, starting a browser can take longer than expected. Again this is fine for me as I don't have that many tests. Also its not the case that the browsers never start in time, just that they sometimes take a bit longer, which introduces a flakyness to my tests. So after I saw that the connection timeout is hardcoded, I thought it might be a good idea to introduce a config option there so that users can adjust the timeout up or down if needed. |
@Malvitus could you add a changelog entry here: https://github.com/Malvitus/cypress/blob/develop/cli/CHANGELOG.md **Features:**
- <Insert change details>. Addressed in [#25848](https://github.com/cypress-io/cypress/pull/25848). |
@mjhenkes Done. Do you need anything else? |
@Malvitus, looks good! Thanks for the contribution. I'll work on getting this merged today. |
Additional details
Currently, there is a hardcoded limit of 62 attempts until a connection to the browser is considered fails. For my usecase, this timeout is sometimes to low and i can't change it.
I added a config value and made sure that it is used at the corresponding places when connections to browsers is attempted.
Steps to test
How has the user experience changed?
In the default usecase, Experience did not change. However when users experience connection timeouts, User can adjust the config value to stabilize their tests.
PR Tasks
cypress-documentation
? (Added new CYPRESS_CONNECT_RETRY_THRESHOLD env cypress-documentation#5070)type definitions
?Other
As this is my first PR for cypress, i am unsure if I did everything right. Should something be amiss, please contact me and I will try my best to solve the issues.