@@ -88,8 +88,7 @@ func (p *Profile) Setup(ctx context.Context, opts *framework.SetupOptions) error
8888
8989func (p * Profile ) Teardown (ctx context.Context , opts * framework.TeardownOptions ) error {
9090 p .verbose = opts .Verbose
91- _ = p .kubectlDelete (ctx , "deploy/kubernetes/llmd-base/httproute-llama-pool.yaml" )
92- _ = p .kubectlDelete (ctx , "deploy/kubernetes/llmd-base/httproute-phi4-pool.yaml" )
91+ _ = p .kubectlDelete (ctx , "e2e/profiles/llm-d/manifests/httproute-services.yaml" )
9392 _ = p .kubectlDelete (ctx , "deploy/kubernetes/llmd-base/dest-rule-epp-llama.yaml" )
9493 _ = p .kubectlDelete (ctx , "deploy/kubernetes/llmd-base/dest-rule-epp-phi4.yaml" )
9594 _ = p .kubectlDelete (ctx , "deploy/kubernetes/llmd-base/inferencepool-llama.yaml" )
@@ -223,10 +222,7 @@ func (p *Profile) deployGatewayRoutes(ctx context.Context) error {
223222 if err := p .kubectlApply (ctx , "deploy/kubernetes/istio/gateway.yaml" ); err != nil {
224223 return err
225224 }
226- if err := p .kubectlApply (ctx , "deploy/kubernetes/llmd-base/httproute-llama-pool.yaml" ); err != nil {
227- return err
228- }
229- if err := p .kubectlApply (ctx , "deploy/kubernetes/llmd-base/httproute-phi4-pool.yaml" ); err != nil {
225+ if err := p .kubectlApply (ctx , "e2e/profiles/llm-d/manifests/httproute-services.yaml" ); err != nil {
230226 return err
231227 }
232228 if err := p .kubectlApply (ctx , "deploy/kubernetes/istio/destinationrule.yaml" ); err != nil {
@@ -247,6 +243,25 @@ func (p *Profile) verifyEnvironment(ctx context.Context, opts *framework.SetupOp
247243 if err != nil {
248244 return err
249245 }
246+
247+ // Actively wait for critical deployments to become Available before checking readiness counts.
248+ // This avoids flakiness when resources are still pulling images just after creation.
249+ deployer := helm .NewDeployer (opts .KubeConfig , opts .Verbose )
250+ deploymentsToWait := []struct {
251+ ns , name string
252+ }{
253+ {semanticNamespace , "semantic-router" },
254+ {gatewayNamespace , "istiod" },
255+ {"default" , "llm-d-inference-scheduler-llama3-8b" },
256+ {"default" , "llm-d-inference-scheduler-phi4-mini" },
257+ {"default" , "inference-gateway-istio" },
258+ }
259+ for _ , d := range deploymentsToWait {
260+ if err := deployer .WaitForDeployment (ctx , d .ns , d .name , 10 * time .Minute ); err != nil {
261+ return fmt .Errorf ("wait for deployment %s/%s: %w" , d .ns , d .name , err )
262+ }
263+ }
264+
250265 if err := helpers .CheckDeployment (ctx , client , semanticNamespace , "semantic-router" , p .verbose ); err != nil {
251266 return err
252267 }
0 commit comments