Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

karma start 0.12 can take minutes to exit after ctrl+c #962

Closed
timbertson opened this issue Mar 17, 2014 · 3 comments
Closed

karma start 0.12 can take minutes to exit after ctrl+c #962

timbertson opened this issue Mar 17, 2014 · 3 comments

Comments

@timbertson
Copy link
Contributor

  1. run karma start config.js with a bare-bones config (an empty browsers list is fine)
  2. navigate a random browser window / tab to http://localhost:9876/ (I can reproduce with both chrome & firefox)
  3. once connected, press ctrl-c in the karma start terminal window

Nothing happens.

After you close the browser tab, still nothing happens.

Eventually you resort to a kill -9 on it.

This happens in the newly released 0.12, but used to work fine in previous versions.

I originally though this was a regression (when I first tried karma it had trouble exiting without a kill -9). But it turns out it does exit eventually after you close the last browser tab, but only after a few minutes.

I did some digging, it seems to be that disconnectBrowsers in server.js calls webServer.close() with a callback function, and webserver.close() waits until everything is totally disconnected before calling the callback. Despite having no browser connected to the server (after I closed it), it takes a couple of minutes for this to happen. I guess it's waiting for connections to time out?

Whatever it's doing, it's frustrating to have to wait minutes, fish out the karma server PID to kill it explicitly, or killall -9 node (and hope that I'm not running any important node processes).

Tested on linux (fedora 20, nodejs 0.10.26).

@MrException
Copy link

I'm also seeing this issue. Ubuntu 12.04, node v0.10.26, karma 0.12.1.

One thing possibly different I am doing is connecting to karma from a browser not on localhost. Running karma on a separate server and connecting to karma using Chrome on my laptop: mydomain.com:9876

@dignifiedquire
Copy link
Member

This should be fixed in #973

@pkozlowski-opensource
Copy link
Member

Agree with @dignifiedquire, this should be fixed by #973. There are still a couple of places where timeouts prevent Karma from exiting ASAP, but those are tracked already by PRs / issues:

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants