-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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(config): Add config option for browser socket timeout #3102
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
|
I signed it! |
CLAs look good, thanks! |
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.
How can we know that this change was successful?
If you set the timeout to 1ms, what do you see in a test?
docs/config/01-configuration-file.md
Outdated
## browserSocketTimeout | ||
**Type:** Number | ||
|
||
**Default:** `2000` |
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.
The default provided upstream in socket.io is 20000. Is there any reason we should not use this default as well?
To me, at worst the extra time will mean that, should the karma server die after launching the browser, the test will last another 18secs. That seems like a small cost for an unusual case.
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.
I changed the default to 20000 in PR #3103 so just change the value here.
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.
Done!
docs/config/01-configuration-file.md
Outdated
to connect. | ||
|
||
When running a browser in different environments, it can take different amounts of time for the | ||
client socket to connect. If Karma cannot connect within the default timeout, you |
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.
Please add a sentence explaining what a user will see in the case that the timeout is too small.
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.
Done!
Log something on all disconnect() calls. Up the timeout as suggested by ndcornelius@ on karma-runner#3102
Log something on all disconnect() calls. Up the timeout as suggested by ndcornelius@ on karma-runner#3102
Log something on all disconnect() calls. Up the timeout as suggested by ndcornelius@ on #3102
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
Add a configuration option that allows modification of the default timeout value for the client socket connection. The previous hardcoded value of 2000 (ms) was insufficent for some environments. Closes #2927
CLAs look good, thanks! |
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.
Thanks!
Sometimes the default timeout for the SocketIO connection attempt isn't enough. There have specifically been issues with the default value of 2000 ms when running with ChromeHeadless. Increasing the timeout value seems to solve this issue in a large number of cases.
This change makes the client timeout value a configuration option. It leaves the default as 2000 ms, but allows for modifying the value if the default is not enough for the browser and environment combination that is targeted.