-
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
Allow browserDisconnectTolerance to be set in non-singleRun mode. #2127
Allow browserDisconnectTolerance to be set in non-singleRun mode. #2127
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. 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, please reply here (e.g.
|
My employer has signed the CLA for me. On a related note, new version of |
Thanks, could you please update your commit message to follow our convention: http://karma-runner.github.io/0.13/dev/git-commit-msg.html |
Thanks for your reply. Will do it tomorrow. |
CLAs look good, thanks! |
I’ll put a draft commit message here in case you would like to comment on it before I do the actual amendment tomorrow:
I marked this as a “fix” because the configuration docs did not mention that this option will not apply in non-singleRun mode. Please let me know if it needs changing. |
Thanks, commit message looks good to me. Can you please also rebase onto latest master as that should make CI happy again |
Allow browserDisconnectTolerance config option to be set in non-singleRun mode. In some cases, the browser would get stuck in an infinite loop (e.g. because of a faulty code/test). This blocks browser’s event loop, preventing it from reporting back to Karma. Karma then considers the browser ‘DISCONNECTED’. Prior to this commit, the `browserDisconnectTolerance` option will only apply in singleRun mode. In above scenario, the end-user must restart Karma to continue running tests inside Karma-managed browsers. This commit fixes this problem by always honoring the aforementioned option.
9c281ea
to
f6587dc
Compare
Thanks for the feedback. Rebased. 😉 |
Thanks |
We’re encountering a problem where sometimes Karma just disconnects and stops running tests until we restart Karma manually.
We found that some of our JavaScript code intermittently gets stuck when running tests — that Karma considers it a time out. One such example is an infinite loop in the code.
Looking at other issues (#598, #1514) suggests adding
browserDisconnectTolerance
. I’ve tried that and several other options to no avail.From further source code inspection, in 19590e1 it turns out that
browserDisconnectTolerance
is only active insingleRun
mode. This pull request makesbrowserDisconnectTolerance
work in non-singleRun mode.Test case
Here’s a test case to verify that my patch works:
test.js
This test will get stuck in an infinite loop with 75% chance.
karma.conf.js
Sets a ridiculously high amount of retries.