karma icon indicating copy to clipboard operation
karma copied to clipboard

fix: karma hangs after finishing tests successfully

Open berkon opened this issue 2 years ago • 2 comments

After successfully finishing all tests, karma hangs for 30 sec with this message:

Chrome Headless 114.0.5735.35 (Windows 10) ERROR Disconnected , because no message in 30000 ms.

This only happens when executing more than approx. 620 tests. It looks like after the state went to DISCONNECTED in these cases there are still some log messages sent. The problem is that in this case also the timeout is restarted and the whole process obviously only terminates after the timer has expired. Therefore I've added an if clause which makes sure that the timer is only started when the state is not already 'DISCONNECTED'.

See more details here: https://stackoverflow.com/questions/76457941/karma-hangs-for-30-seconds-after-successfully-executing-unit-tests

berkon avatar Jun 26 '23 09:06 berkon

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).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar Jun 26 '23 09:06 google-cla[bot]

Thank you ! The only solution internet give for this problem is "Increase the timeout until it work", "increase browser inactivity timeout to 10min" it does not make sense. And finally found your PR, I can finally fix this problem with a real solution !

SebHeuze avatar Nov 02 '23 17:11 SebHeuze