jmreidy / grunt-mocha-webdriver

Grunt task to run Mocha tests against a WebDriver source - either PhantomJS or Sauce Labs
MIT License
36 stars 17 forks source link

kill() does not fire close event #67

Closed binarykitchen closed 10 years ago

binarykitchen commented 10 years ago

Been debugging a case where the grunt task never quit. It hang forever.

I found out that on line https://github.com/jmreidy/grunt-mocha-webdriver/blob/master/tasks/grunt-mocha-wd.js#L100 the kill() command did never fire the close event on the line https://github.com/jmreidy/grunt-mocha-webdriver/blob/master/tasks/grunt-mocha-wd.js#L96

This made the grunt task hang forever. No idea why the phantom child process is never closed. Looks like a bug ...

binarykitchen commented 10 years ago

Okay, I found the cause, see comment https://github.com/jmreidy/grunt-mocha-webdriver/issues/60#issuecomment-42920886

Make sure you test if the PhantomJS process is already killed. If so, either fire the close event manually or run the functions inside the close listener.

jmreidy commented 10 years ago

Is this fixed by #68?

binarykitchen commented 10 years ago

yep