#3820·karma

Unit Tests Sporadically Disconnect on our CI:CD builds

Author: eberhakCreated Oct 13, 2022Updated Aug 26, 2025

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!