karma-runner/karma-chrome-launcher

Chrome have not captured in 60000 ms, killing. Chrome failed 2 times (timeout). Giving up

MarwenHanzouli opened this issue · 2 comments

I encountered this problem when I added the socket.io-client in my angular project, I failed to run the tests, and when i uninstall the scoket from my projet, tests returns to functioning properly..

marwen@marwen:~/Bureau/VeilleTechnologique/darna-frontend$ npm run test

> darna@9.0.0 test /home/marwen/Bureau/VeilleTechnologique/darna-frontend
> ng test

10% building 2/2 modules 0 active09 12 2020 11:44:08.672:WARN [karma]: No captured browser, open http://localhost:9876/
09 12 2020 11:44:08.687:INFO [karma-server]: Karma v4.4.1 server started at http://0.0.0.0:9876/
09 12 2020 11:44:08.688:INFO [launcher]: Launching browsers Chrome with concurrency unlimited
09 12 2020 11:44:08.693:INFO [launcher]: Starting browser Chrome
09 12 2020 11:44:24.735:WARN [karma]: No captured browser, open http://localhost:9876/
09 12 2020 11:45:08.694:WARN [launcher]: Chrome have not captured in 60000 ms, killing.
09 12 2020 11:45:08.845:INFO [launcher]: Trying to start Chrome again (1/2).
09 12 2020 11:46:08.847:WARN [launcher]: Chrome have not captured in 60000 ms, killing.
09 12 2020 11:46:09.050:INFO [launcher]: Trying to start Chrome again (2/2).
09 12 2020 11:47:09.051:WARN [launcher]: Chrome have not captured in 60000 ms, killing.
09 12 2020 11:47:09.229:ERROR [launcher]: Chrome failed 2 times (timeout). Giving up.

I can't run the tests, maybe the problem that karma is started with socket and my project contains a socket too to connect to my backend, how to resolve this problem to run my tests?

  1. Technologies front-end:
"@angular/core": "9.0.0",
"socket.io-client": "^3.0.3",
"@types/socket.io-client": "^1.4.34",
"@types/jasmine": "3.5.3",
"@types/node": "^13.7.0",
"codelyzer": "^5.1.2",
"jasmine-core": "3.5.0",
"jasmine-spec-reporter": "4.2.1",
"karma": "4.4.1",
"karma-chrome-launcher": "3.1.0",
"karma-cli": "~2.0.0",
"karma-coverage-istanbul-reporter": "2.1.1",
"karma-jasmine": "3.1.0",
"karma-jasmine-html-reporter": "1.5.2",
"protractor": "5.4.3",
  1. And in backend: nodejs+express+socket.io

"socket.io": "^3.0.3"

I faced the same issue. solved by this #154 (comment)

I resolved it by changing the version of Socket from 3.x to 2.x