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

Comments

Projects
None yet
1 participant
@pkozlowski-opensource
Copy link
Member

pkozlowski-opensource commented Jun 25, 2014

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

fix(server): Force clients disconnect on Windows
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

fix(server): Force clients disconnect on Windows
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
You can’t perform that action at this time.