{"action":"reopened","issue":{"url":"https://api.github.com/repos/miguelgrinberg/flasky/issues/184","repository_url":"https://api.github.com/repos/miguelgrinberg/flasky","labels_url":"https://api.github.com/repos/miguelgrinberg/flasky/issues/184/labels{/name}","comments_url":"https://api.github.com/repos/miguelgrinberg/flasky/issues/184/comments","events_url":"https://api.github.com/repos/miguelgrinberg/flasky/issues/184/events","html_url":"https://github.com/miguelgrinberg/flasky/issues/184","id":180672203,"number":184,"title":"Unnittest and coverage process hanging with test_selenium.py","user":{"login":"mdublin","id":6722001,"avatar_url":"https://avatars.githubusercontent.com/u/6722001?v=3","gravatar_id":"","url":"https://api.github.com/users/mdublin","html_url":"https://github.com/mdublin","followers_url":"https://api.github.com/users/mdublin/followers","following_url":"https://api.github.com/users/mdublin/following{/other_user}","gists_url":"https://api.github.com/users/mdublin/gists{/gist_id}","starred_url":"https://api.github.com/users/mdublin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdublin/subscriptions","organizations_url":"https://api.github.com/users/mdublin/orgs","repos_url":"https://api.github.com/users/mdublin/repos","events_url":"https://api.github.com/users/mdublin/events{/privacy}","received_events_url":"https://api.github.com/users/mdublin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-10-03T15:35:40Z","updated_at":"2016-10-04T04:53:09Z","closed_at":null,"body":"(running project with python 2.7, Flask 0.10, Mac OSX 10.10.5, Chrome Version 52.0.2743.82 (64-bit))\r\n\r\nWith the addition of `test_selenium.py` to `tests` run with Unittest and Coverage, the selenium test seems to execute properly, browser opens (using Chrome driver here because the current code does not work with Firefox 49.0.1), etc, and the Flask server is started in testing mode and is shutdown with a GET request in the test to the shutdown endpoint, however the terminal window that `python manage.py test --coverage` was executed in just hangs after `Ran 10 tests in 6.00s` and doesn't close/return to the shell prompt. Only way to release process is to kill via `kill [PID]`. \r\n\r\nUsing PyVmMonitor, it appears that the hanging process is indeed associated with the test (this is also confirmed with `pgrep -lf python`), but specifically line 340 in threading.py file and line 155 in SocketServer.py are identified as connected to the hanging process.  \r\n\r\nMy initial interpretation from pages 205-206 is that you have to run `$ python manage.py run` (after you've done `$ export FLASK_CONFIG='testing'` and THEN you run your tests in another shell in the same virtualenv activated environment with `$ python manage.py test --coverage`, but that's when things fail/hang as described above. \r\n\r\nBut after re-reading, perhaps the procedure is to just let the line `threading.Thread(target=cls.app.run).start()` and you don't manually start the server? But this fails as well, with the same process hang. \r\n\r\nHowever, if I comment out `threading.Thread(target=cls.app.run).start()`  and manually start the server, the test runs perfectly and there is no process hang, tests exists and returns me to shell prompt with no issue. \r\n\r\nWhat's the intended correct procedure here? \r\n"}}
{"actor":{"display_login":"mdublin"}}