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
testem doesn't close phantomjs v1.7.0 on OSX #92
Comments
Killing phantomjs is problematic sometimes. But it happens only very sporadically for me so it's hard to test. But it looks like it's happening every time for you. Can you share a gist with me so I can test with the exact same setup? |
For me the issue happens every time an error kills the session. For example, if I have invalid JSON sytax in the testem.json file, then the testem process crashes and PhantomJS does not die. |
Ah, I see. I'll try that. |
Here is a gist which exhibits the behavior https://gist.github.com/4160751 . It doesn't depend on the particular ok/error results. |
Thanks, I downloaded your gist, but still can't reproduce what you are seeing though. However, I make an attempt at a fix by speculation. Can you try testing this branch and see if that fixes it? |
Thanks for the branch! I just tested it and found it is still not working. Still the same effect. But at least I now get an idea on where to start and perhaps try to debug this later. |
Tested the problem with phantomjs 1.5.0 and that version doesn't exhibit the problem. The issue goes away if do phantom.exit() inside the launcher script. So it would be nice to be able to deliver the socket communication to the phantom script and do phantom.exit() properly. Perhaps by wrapping socket.emit() with something that communicates via onConsoleMessage() with phantomjs which would be able to shut properly. |
This issue is probably related https://groups.google.com/forum/?fromgroups=#!topic/phantomjs/kaEzJ45VS0c Ideally, I would like to avoid writing phantomjs specific code just for this, but if it's the only way... @opichals could you experiment with your approach and see if it works? |
Thanks for the phantomjs discussion link. It looks like they eventually found a reliable way. Will see if that helps. In any case it would be nice if testem could shut phantom properly. However like you wrote, having a phantomjs specific launcher doesn't sound as a clear solution and phantomjs script cannot probably communicate with the page in other than console message terms... on the other hand having a console.log in emit() method of the tie socket wrapper doesn't sounds that bad, or does it? |
With a master build of phantomjs the original https://gist.github.com/4160751 passes without leaving phantomjs instance running. So consider that part solved. Now I have updated the test page to simulate a test 'failure' (pull the gist again for simulation). And that one results into the following output (while leaving a phantomjs process running):
|
@opichals I fixed this. Could you retest? It will still throw this exception, but the phantom process should be cleaned up. |
Confirmed, fixed. Thanks!!! |
It is probably missing the phantom.exit() call after all-tests-results message was received? Could you please have a look?
The text was updated successfully, but these errors were encountered: