summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/hashserv/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/hashserv/tests.py')
-rw-r--r--bitbake/lib/hashserv/tests.py8
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
8import unittest 8import unittest
9import threading 9import multiprocessing
10import sqlite3 10import sqlite3
11import hashlib 11import hashlib
12import urllib.request 12import 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)