diff options
Diffstat (limited to 'bitbake/lib/hashserv/tests.py')
-rw-r--r-- | bitbake/lib/hashserv/tests.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bitbake/lib/hashserv/tests.py b/bitbake/lib/hashserv/tests.py index 15f4a52ee9..6845b53884 100644 --- a/bitbake/lib/hashserv/tests.py +++ b/bitbake/lib/hashserv/tests.py | |||
@@ -6,7 +6,7 @@ | |||
6 | # | 6 | # |
7 | 7 | ||
8 | import unittest | 8 | import unittest |
9 | import threading | 9 | import multiprocessing |
10 | import sqlite3 | 10 | import sqlite3 |
11 | import hashlib | 11 | import hashlib |
12 | import urllib.request | 12 | import urllib.request |
@@ -21,16 +21,16 @@ class TestHashEquivalenceServer(unittest.TestCase): | |||
21 | self.dbfile = tempfile.NamedTemporaryFile(prefix="bb-hashserv-db-") | 21 | self.dbfile = tempfile.NamedTemporaryFile(prefix="bb-hashserv-db-") |
22 | self.server = create_server(('localhost', 0), self.dbfile.name) | 22 | self.server = create_server(('localhost', 0), self.dbfile.name) |
23 | self.server_addr = 'http://localhost:%d' % self.server.socket.getsockname()[1] | 23 | self.server_addr = 'http://localhost:%d' % self.server.socket.getsockname()[1] |
24 | self.server_thread = threading.Thread(target=self.server.serve_forever) | 24 | self.server_thread = multiprocessing.Process(target=self.server.serve_forever) |
25 | self.server_thread.daemon = True | ||
25 | self.server_thread.start() | 26 | self.server_thread.start() |
26 | 27 | ||
27 | def tearDown(self): | 28 | def tearDown(self): |
28 | # Shutdown server | 29 | # Shutdown server |
29 | s = getattr(self, 'server', None) | 30 | s = getattr(self, 'server', None) |
30 | if s is not None: | 31 | if s is not None: |
31 | self.server.shutdown() | 32 | self.server_thread.terminate() |
32 | self.server_thread.join() | 33 | self.server_thread.join() |
33 | self.server.server_close() | ||
34 | 34 | ||
35 | def send_get(self, path): | 35 | def send_get(self, path): |
36 | url = '%s/%s' % (self.server_addr, path) | 36 | url = '%s/%s' % (self.server_addr, path) |