-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Repeatedly disconnected from Chrome (mac) #1514
Comments
Is Chrome in the background or foreground when that happens? |
In the background. This typically happens when I make changes to a code or test file in my IDE, causing the test run to fire. |
To elaborate, I notice that the tests always seem to go through fine when I launch Karma, but every time a file change happens it starts running the tests and then hangs for a bit, and complains about a browser disconnect. I'm also using some other components with Karma like code coverage. Here is my config file:
|
I'm afraid that this is related to the great power savings on OS X + Chrome, can you try keeping the browser in the foreground (visibility is important) and see if it still happens? |
Looks like that does the trick. It hasn't had any issues since I've kept it visible. Thanks! |
Also if I quickly bring the browser into the foreground while it hangs the tests complete successfully. |
I can attest that I am also experiencing this issue. Focusing the Chrome window during the test run seems to be the only way to get it to complete. I've noticed this does not happen when only running a small number of tests (such as with (OSX 10.10.4 + Chrome) UPDATE: |
EDIT: The fix that worked for me was to add Same issue - but running chrome in the foreground does not help. Versions:
I've tried:
karma.conf.coffee: module.exports = (config) ->
config.set
frameworks: [ "jasmine" ]
files: [...] # ~500 files
exclude: [...]
preprocessors: {
'**/*.js': ['sourcemap']
}
reporters: ['mocha']
mochaReporter:
ignoreSkipped: yes
autowatch: yes
port: 9292
colors: process.platform is 'darwin'
logLevel: config.LOG_INFO
autoWatch: true
reportSlowerThan: 200
browsers: ['Chrome']
browserNoActivityTimeout: 100000
captureTimeout: 60 * 1000
singleRun: true
captureConsole: true
useIframe: false
restartOnFileChange: true |
We're using phantomjs now to run the tests anyway so that might also help as a workaround :) |
The solution posted by @bcherny seems to at least suppress the error, but the output is still quite funky: PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 11 of 11 SUCCESS (0.077 secs / 0.015 secs)
Safari 9.0.3 (Mac OS X 10.11.3): Executed 11 of 11 SUCCESS (0.074 secs / 0.012 secs)
Chrome 50.0.2661 (Mac OS X 10.11.3): Executed 11 of 11 SUCCESS (0.075 secs / 0.017 secs)
Firefox 42.0.0 (Mac OS X 10.11.0): Executed 11 of 11 SUCCESS (0.1 secs / 0.011 secs)
TOTAL: 44 SUCCESS
DEBUG [karma]: Run complete, exiting.
DEBUG [launcher]: Disconnecting all browsers
DEBUG [framework.browserify]: cleaning up
PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 11 of 11 SUCCESS (0.077 secs / 0.015 secs)
Safari 9.0.3 (Mac OS X 10.11.3): Executed 11 of 11 DISCONNECTED (10.093 secs / 0.012 secs)
PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 11 of 11 SUCCESS (0.077 secs / 0.015 secs)
Safari 9.0.3 (Mac OS X 10.11.3): Executed 11 of 11 DISCONNECTED (10.093 secs / 0.012 secs)
Chrome 50.0.2661 (Mac OS X 10.11.3): Executed 11 of 11 DISCONNECTED (10.094 secs / 0.017 secs)
Firefox 42.0.0 (Mac OS X 10.11.0): Executed 11 of 11 SUCCESS (0.1 secs / 0.011 secs)
INFO [karma]: Restarting Chrome 50.0.2661 (Mac OS X 10.11.3) (1 of 10 attempts) |
Chrome recently updated on my mac, and I'm now running Chrome 44.0.2403 (Mac OS X 10.10.3) and have Karma v0.13.3. Sometimes all of my tests will run, but they start breaking when the test runner disconnects from Chrome:
The text was updated successfully, but these errors were encountered: