File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -274,10 +274,11 @@ def pytest_generate_tests(metafunc: pytest.Metafunc):
274
274
275
275
@pytest .fixture (scope = "session" )
276
276
def python_server (environment ):
277
+ assert not _check_port_open ("localhost" , environment .get_local_server_port ())
278
+
277
279
proc = Process (
278
280
target = start_test_local_server ,
279
281
args = (environment .feature_store .repo_path , environment .get_local_server_port ()),
280
- daemon = True ,
281
282
)
282
283
if (
283
284
environment .python_feature_server
@@ -298,6 +299,15 @@ def python_server(environment):
298
299
if proc .is_alive ():
299
300
proc .kill ()
300
301
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
+
301
311
302
312
def _check_port_open (host , port ) -> bool :
303
313
with closing (socket .socket (socket .AF_INET , socket .SOCK_STREAM )) as sock :
You can’t perform that action at this time.
0 commit comments