File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -274,10 +274,11 @@ def pytest_generate_tests(metafunc: pytest.Metafunc):
274274
275275@pytest .fixture (scope = "session" )
276276def python_server (environment ):
277+ assert not _check_port_open ("localhost" , environment .get_local_server_port ())
278+
277279 proc = Process (
278280 target = start_test_local_server ,
279281 args = (environment .feature_store .repo_path , environment .get_local_server_port ()),
280- daemon = True ,
281282 )
282283 if (
283284 environment .python_feature_server
@@ -298,6 +299,15 @@ def python_server(environment):
298299 if proc .is_alive ():
299300 proc .kill ()
300301
302+ # wait server to free the port
303+ wait_retry_backoff (
304+ lambda : (
305+ None ,
306+ not _check_port_open ("localhost" , environment .get_local_server_port ()),
307+ ),
308+ timeout_secs = 30 ,
309+ )
310+
301311
302312def _check_port_open (host , port ) -> bool :
303313 with closing (socket .socket (socket .AF_INET , socket .SOCK_STREAM )) as sock :
You can’t perform that action at this time.
0 commit comments