@@ -181,7 +181,7 @@ def validate_json(message: Any, schema: Any) -> None:
181181 assert False , "The provided schema is faulty:" + str (e )
182182
183183
184- def wait_for_container_health (container_name : str , max_attempts : int = 6 ) -> None :
184+ def wait_for_container_health (container_name : str , max_attempts : int = 20 ) -> None :
185185 """Wait for container to be healthy.
186186
187187 Polls a Docker container until its health status becomes `healthy` or the
@@ -192,14 +192,17 @@ def wait_for_container_health(container_name: str, max_attempts: int = 6) -> Non
192192 inspect errors or timeouts are ignored and retried; the function returns
193193 after the container is observed healthy or after all attempts complete.
194194
195+ OpenTelemetry instrumentation adds initialization overhead, so the default
196+ has been set to 20 attempts (40 seconds) to prevent timeouts.
197+
195198 Returns:
196199 -------
197200 None
198201
199202 Parameters:
200203 ----------
201204 container_name (str): Docker container name or ID to check.
202- max_attempts (int): Maximum number of health check attempts (default 6 ).
205+ max_attempts (int): Maximum number of health check attempts (default 20 ).
203206 """
204207 if is_prow_environment ():
205208 wait_for_pod_health (container_name , max_attempts )
@@ -468,9 +471,10 @@ def restart_container(container_name: str) -> None:
468471
469472 # Wait for container to be healthy.
470473 # Library mode embeds llama-stack, so the container takes longer to start
471- # (~45-60s vs ~10s in server mode). Use a generous attempt count so
472- # MCP-auth scenarios that restart the container don't time out.
473- wait_for_container_health (container_name , max_attempts = 12 )
474+ # (~45-60s vs ~10s in server mode). OpenTelemetry instrumentation adds
475+ # initialization overhead. Use a generous attempt count so MCP-auth scenarios
476+ # that restart the container don't time out.
477+ wait_for_container_health (container_name , max_attempts = 20 )
474478
475479 if container_name == "llama-stack" :
476480 from tests .e2e .features .steps .health import (
0 commit comments