Jasmine doesn't terminate correctly in case it encounters some errors
danilaml opened this issue · 4 comments
Problem: If I have browser or WebDriver missing from my path, jasmine
would only output error:
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.
And lots of log messages like
[16/Aug/2018:17:57:41] ENGINE Bus STOPPING
[16/Aug/2018:17:57:41] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('127.0.0.1', 48657)) already shut down
[16/Aug/2018:17:57:41] ENGINE Stopped thread 'Autoreloader'.
[16/Aug/2018:17:57:41] ENGINE Bus STOPPED
[16/Aug/2018:17:57:41] ENGINE Bus STOPPING
But won't terminate. It creates troubles for CI since instead of reporting the error the test sutie would wait for jasmine to finish (which it'll never do) until it reaches some sort of timeout (which could be hours of wait).
Furthermore, it'll ignore Ctrl+C
.
Hmmm, I'm not seeing quite that same behavior. What version of Jasmine are you using, and what OS? I'm definitely seeing a lot of logging of cherrypy shutting down under those circumstances, but it doesn't seem to hang unless I redirect stdout. Even if I redirect stdout, I'm still able to Ctrl+C
to shut it down.
It doesn't happen 100% of the time, but it is rather frequent. I had experienced it on both 2.99 and 3.1, Windows (had to use Ctrl+Shift+Break
) and Linux (Ctrl+\
).
Ok, I've updated the way we load up the browser to separate it out from creating the test server a bit, and I think this should help with the error messages and thread joining if the browser can't be started. If you can run from the github repo here to confirm whether this solves this issue for you, I would appreciate it. If it does solve it, I can make a point release, if not I'll just leave the refactor in until there is something more interesting to release.
Hope this helps. Thanks for using Jasmine!
The proposed fix has been released at this point and we haven't heard anything else, so I'm going to close this.