Skip to content
Snippets Groups Projects
Commit a44e8a96 authored by Christopher Randolph Rhodes's avatar Christopher Randolph Rhodes
Browse files

Also join server process on teardown, this corrected some multiprocess spillover issues e.g. STDOUT

parent d1d2ebe8
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,7 @@ class TestServerBaseClass(unittest.TestCase):
def setUp(self) -> None:
import uvicorn
host = '127.0.0.1'
port = 5001
port = 5001 # TODO: defer to run_server script and conf file
self.server_process = Process(
target=uvicorn.run,
......@@ -26,6 +26,8 @@ class TestServerBaseClass(unittest.TestCase):
self.uri = f'http://{host}:{port}/'
self.server_process.start()
print('started server process')
def _get_sesh(self):
sesh = requests.Session()
retries = Retry(
......@@ -58,6 +60,7 @@ class TestServerBaseClass(unittest.TestCase):
def tearDown(self) -> None:
self.server_process.terminate()
self.server_process.join()
class TestApiFromAutomatedClient(TestServerBaseClass):
def test_trivial_api_response(self):
......@@ -73,6 +76,7 @@ class TestApiFromAutomatedClient(TestServerBaseClass):
def test_default_session_paths(self):
import model_server.conf.defaults
resp = self._get('paths')
print(resp.json()['outbound_images'])
conf_root = model_server.conf.defaults.root
for p in ['inbound_images', 'outbound_images', 'logs']:
self.assertTrue(resp.json()[p].startswith(conf_root.__str__()))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment