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
Unit Tests Sporadically Disconnect on our CI:CD builds #3820
Comments
I am experiencing this issue as-well in Angular 13 and we saw this issue in Angular 10 too
From the debugging output
@eberhak though I'm facing a similar issue, I've heard people have had success by modifying the following in the karma config
|
Hi @matttm Thanks for the advice on the config file. I can see this mitigating the issue, but the heart of the problem remains. Why does the browser even feel the need to disconnect in the first place? Is it just a network issue or is there a known bug with Karma? Do you have any insight on this or do you know anyone who does? Thanks! |
@eberhak I am not sure of what's causing the issue in karma. Frankly, I became frustrated with karma and started a migration to jest using jest-jasmine2 test runner, so we could keep our tests, but there are some hiccups with that. Doing it though, I have had to modify some tests because they were failing under jest, but the some of the errors seem like things that should've errored under karma. For example, I had to fix a number of tests that were missing imported modules in the harness. Maybe this was some misconfiguration on my part as for why I'm seeing it now. I also caught a couple mem leaks from subscribers never unsubscribing. I think these may have played a role. |
Do we have a solution for this issue ? I have tried out the timeout configuration in karma config file as well, as advised in other issue threads but none of it resolves the issue for me. |
Hi Karma Team,
Thanks for your help! |
Any updates? I have the same issue! |
Hi Karma Team, |
Hi Karma team,
I'm part of an Angular project for my organization with a CI:CD build running approx. 1260 unit tests. We run these unit tests as part of a nightly build.
Our builds run the following command to launch the unit tests:
ng test [project_name] --browsers=ChromeHeadless --watch=false --source-map=false
After 921 passing tests, the unit test portion of our build fails with the following error:
Disconnected (0 times) reconnect failed before timeout of 2000ms (ping timeout)
This issue happens only on CI:CD, I never get it locally when running unit tests on my machine. Even then, we don't get this for every build. It happens randomly.
We're using Angular version 13.2.6 and the following Karma versions:
"karma": "~6.3.17",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.0.3",
"karma-jasmine": "~4.0.1",
"karma-jasmine-html-reporter": "^1.7.0",
"karma-scss-preprocessor": "^4.0.0",
What are some potential root causes we can troubleshoot to better understand why the unit tests randomly disconnect. Please advise. Thank you!
The text was updated successfully, but these errors were encountered: