File tree Expand file tree Collapse file tree 1 file changed +20
-17
lines changed Expand file tree Collapse file tree 1 file changed +20
-17
lines changed Original file line number Diff line number Diff line change @@ -48,22 +48,25 @@ def after_scenario(context: Context, scenario: Scenario) -> None:
4848
4949 # Check if it's healthy
5050 for attempt in range (6 ): # Try for 30 seconds
51- result = subprocess .run (
52- [
53- "docker" ,
54- "exec" ,
55- "llama-stack" ,
56- "curl" ,
57- "-f" ,
58- "http://localhost:8321/v1/health" ,
59- ],
60- capture_output = True ,
61- timeout = 5 ,
62- check = True ,
63- )
64- if result .returncode == 0 :
65- print ("✓ Llama Stack connection restored successfully" )
66- break
51+ try :
52+ result = subprocess .run (
53+ [
54+ "docker" ,
55+ "exec" ,
56+ "llama-stack" ,
57+ "curl" ,
58+ "-f" ,
59+ "http://localhost:8321/v1/health" ,
60+ ],
61+ capture_output = True ,
62+ timeout = 5 ,
63+ check = True ,
64+ )
65+ if result .returncode == 0 :
66+ print ("✓ Llama Stack connection restored successfully" )
67+ break
68+ except subprocess .TimeoutExpired :
69+ print (f"⏱Health check timed out on attempt { attempt + 1 } /6" )
6770
6871 if attempt < 5 :
6972 print (
@@ -77,7 +80,7 @@ def after_scenario(context: Context, scenario: Scenario) -> None:
7780
7881 except subprocess .CalledProcessError as e :
7982 print (f"Warning: Could not restore Llama Stack connection: { e } " )
80-
83+
8184
8285def before_feature (context : Context , feature : Scenario ) -> None :
8386 """Run before each feature file is exercised."""
You can’t perform that action at this time.
0 commit comments