Skip to content
Browse files

Fixes possible deadlock in threads.

  • Loading branch information...
1 parent 82cee12 commit 52cdb26781a5fe6f293684f322217ac9c8b2c00b @schlamar schlamar committed Apr 5, 2013
Showing with 6 additions and 0 deletions.
  1. +6 −0 dummyserver/testcase.py
View
6 dummyserver/testcase.py
@@ -32,6 +32,11 @@ def _start_server(cls, socket_handler):
# Lock gets released by thread above
ready_lock.acquire()
+ @classmethod
+ def tearDownClass(cls):
+ if hasattr(cls, 'server_thread'):
+ cls.server_thread.join()
+
class HTTPDummyServerTestCase(unittest.TestCase):
scheme = 'http'
@@ -54,6 +59,7 @@ def _start_server(cls):
@classmethod
def _stop_server(cls):
cls.server_thread.stop()
+ cls.server_thread.join()
@classmethod
def setUpClass(cls):

0 comments on commit 52cdb26

Please sign in to comment.
Something went wrong with that request. Please try again.