karma-chrome-launcher
karma-chrome-launcher copied to clipboard
karma crashes when chrome is already running
When launching the karma test with chrome already running, three karma tabs open, connect, lose the connection again and then karma crashes. When you close two of the tabs fast enough, everything works.
INFO [karma]: Karma v0.12.31 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
DEBUG [temp-dir]: Creating temp dir at C:\Users\[...]\AppData\Local\Temp\karma-40710999
DEBUG [launcher]: C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --user-data-dir=C:\Users\[...]\AppData\Local\Temp\karma-40710999 --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate ht
tp://localhost:9876/?id=40710999
DEBUG [framework.browserify]: building bundle
DEBUG [framework.browserify]: adding [...] to bundle
DEBUG [launcher]: Process Chrome exited with code 0
ERROR [launcher]: Cannot start Chrome
DEBUG [temp-dir]: Cleaning temp dir C:\Users\[...]\AppData\Local\Temp\karma-40710999
INFO [launcher]: Trying to start Chrome again (1/2).
DEBUG [launcher]: Restarting Chrome
DEBUG [temp-dir]: Creating temp dir at C:\Users\[...]\AppData\Local\Temp\karma-40710999
DEBUG [launcher]: C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --user-data-dir=C:\Users\[...]\AppData\Local\Temp\karma-40710999 --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate ht
tp://localhost:9876/?id=40710999
DEBUG [launcher]: Process Chrome exited with code 0
ERROR [launcher]: Cannot start Chrome
DEBUG [temp-dir]: Cleaning temp dir C:\Users\[...]\AppData\Local\Temp\karma-40710999
INFO [launcher]: Trying to start Chrome again (2/2).
DEBUG [launcher]: Restarting Chrome
DEBUG [temp-dir]: Creating temp dir at C:\Users\[...]\AppData\Local\Temp\karma-40710999
DEBUG [launcher]: C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --user-data-dir=C:\Users\[...]\AppData\Local\Temp\karma-40710999 --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate ht
tp://localhost:9876/?id=40710999
DEBUG [framework.browserify]: bundling
DEBUG [launcher]: Process Chrome exited with code 0
ERROR [launcher]: Cannot start Chrome
DEBUG [temp-dir]: Cleaning temp dir C:\Users\[...]\AppData\Local\Temp\karma-40710999
DEBUG [web-server]: serving: D:\[...]\node_modules\karma\static/client.html
DEBUG [web-server]: serving (cached): D:\[...]\node_modules\karma\static/client.html
ERROR [launcher]: Chrome failed 2 times (cannot start). Giving up.
DEBUG [web-server]: serving (cached): D:\[...]\node_modules\karma\static/client.html
DEBUG [web-server]: serving: D:\[...]\node_modules\karma\static/karma.js
DEBUG [web-server]: serving (cached): D:\[...]\node_modules\karma\static/karma.js
DEBUG [web-server]: serving (cached): D:\[...]\node_modules\karma\static/karma.js
[...]
DEBUG [web-server]: upgrade /socket.io/1/websocket/hZrbHj-2BzuPr_YNkUmW
DEBUG [karma]: A browser has connected on socket hZrbHj-2BzuPr_YNkUmW
DEBUG [web-server]: upgrade /socket.io/1/websocket/9Nh06gkCmfm7Ag4dkUmX
DEBUG [karma]: A browser has connected on socket 9Nh06gkCmfm7Ag4dkUmX
DEBUG [web-server]: upgrade /socket.io/1/websocket/JFZ5G4UQX3ciOHOnkUmY
DEBUG [karma]: A browser has connected on socket JFZ5G4UQX3ciOHOnkUmY
INFO [Chrome 39.0.2171 (Windows 8.1)]: Connected on socket hZrbHj-2BzuPr_YNkUmW with id 40710999
DEBUG [launcher]: Chrome (id 40710999) captured in 4.242 secs
DEBUG [Chrome 39.0.2171 (Windows 8.1)]: New connection 9Nh06gkCmfm7Ag4dkUmX (already have hZrbHj-2BzuPr_YNkUmW)
DEBUG [Chrome 39.0.2171 (Windows 8.1)]: New connection JFZ5G4UQX3ciOHOnkUmY (already have hZrbHj-2BzuPr_YNkUmW, 9Nh06gkCmfm7Ag4dkUmX)
DEBUG [watcher]: Add file "D:/fab3d-lowfab/testClient/stlImportTest.coffee" ignored. Already in the list.
WARN [Chrome 39.0.2171 (Windows 8.1)]: Disconnected (1 times), because no message in 10000 ms.
ERROR [karma]: [TypeError: Cannot call method 'map' of undefined]
TypeError: Cannot call method 'map' of undefined
at [object Object]._render (D:\[...]\node_modules\karma\lib\reporters\progress.js:56:27)
at [object Object]._refresh (D:\[...]\node_modules\karma\lib\reporters\progress.js:60:34)
at [object Object].onBrowserComplete (D:\[...]\node_modules\karma\lib\reporters\progress.js:19:21)
at [object Object].<anonymous> (D:\[...]\node_modules\karma\lib\events.js:15:22)
at [object Object].emit (events.js:117:20)
at [object Object]._onTimeout (D:\[...]\node_modules\karma\lib\browser.js:53:15)
at Timer.listOnTimeout [as ontimeout] (timers.js:112:15)
DEBUG [launcher]: Disconnecting all browsers
DEBUG [framework.browserify]: cleaning up
I am having the same issue
Hello,
I've the same problem, except that my configuration is a bit different:
- Windows 7 64 bits, no administrator rights
- Chrome 40.0.2214.91 (Liberkey version)
- Firefox 35 (Liberkey version)
- I'm using these dependencies :
"karma" : "0.12.31",
"karma-jasmine" : "0.3.5",
"karma-chrome-launcher" : "0.1.7",
"karma-firefox-launcher": "0.1.4",
"jasmine-core" : "2.2.0",
Note that :
- Even if Chrome is not already launched, Chrome will start and open the three tabs.
- It is working properly when I use
Firefox
instead ofChrome
in the karmabrowsers
variable. - If I choose not to launch browsers when Karma start, and that I open Chrome and go to
http://localhost:9876
manually, everything works properly.
Has anyone of you found a solution to this problem ?
Tell me if I can give you more information.
Thank you.
+1 I have the same problem
The /?id=1231231
part makes the browser freeze. If you manually remove it, it'll get connected. I don't know why.
I'm also getting this problem ever since our IT department changed something in Chrome. Has anyone found a solution?
Yea, I'm getting this as well (I think). I found that restarting my computer makes the non-debug mode work better.
This has been a problem for us as well recently running with Chrome in Jenkins
Same issue than @ncelerier
OS: WIndow 7 32bits
same dependencies
Same issue, fewer dependencies (no Firefox launcher)
Same exact issue - has this been fixed yet?
I had the same issue & I didn't have the choice to change to other launcher. So to fix this without changing chrome launcher, I had to set CHROME_BIN ENV to firefox binary!
I am facing the same issue. Is it planned to be fixed?
Same issue... Here is my package.config: { "devDependencies": { "jasmine-core": "^2.4.1", "karma": "^1.1.1", "karma-chrome-launcher": "^1.0.1", "karma-jasmine": "^1.0.2" } }
Here is my console output: LearningAng> karma start karma.conf.js 08 07 2016 09:03:30.680:WARN [karma]: No captured browser, open http://localhost :9876/ 08 07 2016 09:03:30.696:INFO [karma]: Karma v1.1.1 server started at http://loca lhost:9876/ 08 07 2016 09:03:30.696:INFO [launcher]: Launching browser Chrome with unlimited concurrency 08 07 2016 09:03:30.696:INFO [launcher]: Starting browser Chrome 08 07 2016 09:03:30.954:ERROR [launcher]: Cannot start Chrome
08 07 2016 09:03:30.962:INFO [launcher]: Trying to start Chrome again (1/2). 08 07 2016 09:03:31.281:ERROR [launcher]: Cannot start Chrome
08 07 2016 09:03:31.285:INFO [launcher]: Trying to start Chrome again (2/2). 08 07 2016 09:03:31.667:ERROR [launcher]: Cannot start Chrome
08 07 2016 09:03:31.675:ERROR [launcher]: Chrome failed 2 times (cannot start). Giving up. 08 07 2016 09:03:31.771:INFO [Chrome 51.0.2704 (Windows 7 0.0.0)]: Connected on socket /#8PR6KiLHarkZSz3AAAAA with id 19866284
Here is my output when closing the tabs
LearningAng> karma start karma.conf.js 08 07 2016 09:04:52.698:WARN [karma]: No captured browser, open http://localhost :9876/ 08 07 2016 09:04:52.698:INFO [karma]: Karma v1.1.1 server started at http://loca lhost:9876/ 08 07 2016 09:04:52.698:INFO [launcher]: Launching browser Chrome with unlimited concurrency 08 07 2016 09:04:52.729:INFO [launcher]: Starting browser Chrome 08 07 2016 09:04:53.007:ERROR [launcher]: Cannot start Chrome
08 07 2016 09:04:53.016:INFO [launcher]: Trying to start Chrome again (1/2). 08 07 2016 09:04:53.353:ERROR [launcher]: Cannot start Chrome
08 07 2016 09:04:53.362:INFO [launcher]: Trying to start Chrome again (2/2). 08 07 2016 09:04:53.818:ERROR [launcher]: Cannot start Chrome
08 07 2016 09:04:53.836:ERROR [launcher]: Chrome failed 2 times (cannot start). Giving up. 08 07 2016 09:04:53.885:INFO [Chrome 51.0.2704 (Windows 7 0.0.0)]: Connected on socket /#S1mJTJaQzbRhs0KDAAAA with id 88919744 08 07 2016 09:04:56.603:WARN [Chrome 51.0.2704 (Windows 7 0.0.0)]: Disconnected (1 times) 08 07 2016 09:04:56.610:ERROR [karma]: [TypeError: Cannot read property 'map' of undefined] TypeError: Cannot read property 'map' of undefined at _render (c:\ShawnDocs\Apprenticeships\week13\Test Envoriment\LearningAngT DD\usingNode\CalculatorKarma\node_modules\karma\lib\reporters\progress.js:53:26)
at writeCommonMsg (c:\ShawnDocs\Apprenticeships\week13\Test Envoriment\Learn
ingAngTDD\usingNode\CalculatorKarma\node_modules\karma\lib\reporters\progress.js
:9:44)
at onBrowserError (c:\ShawnDocs\Apprenticeships\week13\Test Envoriment\Learn
ingAngTDD\usingNode\CalculatorKarma\node_modules\karma\lib\reporters\base.js:63:
10)
at null.
LearningAng>
We also ran into this when using https://github.com/mark-adams/docker-chromium-xvfb and spawning more than one karma process in parallel]
Edit: We just see a ERROR [launcher]: Chrome crashed.
(typically after INFO [launcher]: Starting browser Chrome
)
In the configuration file for your project (e.g. karma.config.js), check if you have the plugins listed plugins : [ 'karma-junit-reporter', 'karma-chrome-launcher', 'karma-firefox-launcher', 'karma-opera-launcher', 'karma-ie-launcher', 'karma-jasmine' ],
Somebody who found a solution for this issue?
Has anyone seen this on any platform other than Windows 7?
Just to set expectations: there are no steps to reproduce this issue so someone who has the problem is going to have to dig in and sort it out. Anyone who has this happen every time has a good chance to track it down. For examples: Add logging to karma-chrome-launcher; log the exact commands it issues; try those commands directly.
I’m still seeing this issue on Windows 7. Any pointers on where I should start digging/adding logs?
I have the same issue. I've figured out that the reason is "--user-data-dir" flag in command chrome.exe --user-data-dir=C:\Users\SIARHE~1\AppData\Local\Temp\karma-96883176 --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-background-timer-throttling --disable-renderer-backgrounding --disable-device-discovery-notifications http://localhost:9876/?id=96883176 Could anyone help me with further steps?
Completely separately I've found that chrome misbehaves if the user-data-dir is not writable. Maybe check that.
I've tried with other folders. It only works if I remove this flag. Moreover, a folder for user data is created successfully by Chrome.