Skip to content
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

setTimout in socket.io prevents Karma from exiting on Windows #1109

Closed
pkozlowski-opensource opened this issue Jun 25, 2014 · 0 comments · Fixed by #1121 · May be fixed by Omrisnyk/npm-lockfiles#122 or Omrisnyk/npm-lockfiles#132
Closed

Comments

@pkozlowski-opensource
Copy link
Member

Taken from karma-runner/gulp-karma#5

There is a setTimeout in socket.io (https://github.com/Automattic/socket.io/blob/0.9/lib/transport.js#L216) that prevents Karma from exiting. Interestingly this timeout prevents Karma from exiting on Windows only, OSX and Linux is not affected.

Yesterday my colleague have discovered that this could be worked-around by explicitly disconnecting each socket on Karma exit (basically adding sockets[key].disconnect() here: https://github.com/karma-runner/karma/blob/v0.12.16/lib/server.js#L201). I'm not familiar with the socket.io internals well enough so I'm not sure if this is the right thing to do, but I'm kind of loosing hope of having any fixes done in the socket.io version that Karma is using atm.

Would be grateful for any input here, especially from the ones knowing karma + socket.io interactions a bit better.

@pkozlowski-opensource pkozlowski-opensource changed the title setTimout in socket.io prevents Karma from existing on Windows setTimout in socket.io prevents Karma from exiting on Windows Jul 1, 2014
bcharbonnier added a commit to bcharbonnier/karma that referenced this issue Jul 1, 2014
It occurs that only on Windows, socket.io clients are not properly disconnected, which causes Karma to not exit immediately when everything is done. We have to wait for some internal disconnection socket.io event timeout.

This PR basically check if all sockets are disconnected. If not we manually force the disconnection.

Fixes karma-runner#1109
bcharbonnier added a commit to bcharbonnier/karma that referenced this issue Jul 1, 2014
It occurs that only on Windows, socket.io clients are not properly disconnected, which causes Karma to not exit immediately when everything is done. We have to wait for some internal disconnection socket.io event timeout.

This PR basically check if all sockets are disconnected. If not we manually force the disconnection.

Fixes karma-runner#1109
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment