@@ -200,7 +200,9 @@ var _ = Describe("[cloud-provider-aws-e2e] loadbalancer", func() {
200200 LoadBalancerArn : aws .String (lbARN ),
201201 })
202202 framework .ExpectNoError (err , "failed to describe target groups" )
203- framework .ExpectEqual (len (targetGroups .TargetGroups ), 1 )
203+ if len (targetGroups .TargetGroups ) != 1 {
204+ framework .Failf ("Target group size mismatch for %s: expected 1, got %v" , lbARN , targetGroups .TargetGroups )
205+ }
204206
205207 targetGroupAttributes , err := elbClient .DescribeTargetGroupAttributes (e2e .ctx , & elbv2.DescribeTargetGroupAttributesInput {
206208 TargetGroupArn : aws .String (aws .ToString (targetGroups .TargetGroups [0 ].TargetGroupArn )),
@@ -255,7 +257,7 @@ var _ = Describe("[cloud-provider-aws-e2e] loadbalancer", func() {
255257 framework .Logf ("[SETUP] Test case: %s" , tc .name )
256258 framework .Logf ("[SETUP] Worker nodes discovered: %d nodes, selector: %s, sample node: %s" , e2e .nodeCount , e2e .nodeSelector , e2e .nodeSingleSample )
257259
258- loadBalancerCreateTimeout := e2eservice .GetServiceLoadBalancerCreationTimeout (cs )
260+ loadBalancerCreateTimeout := e2eservice .GetServiceLoadBalancerCreationTimeout (context . TODO (), cs )
259261 framework .Logf ("[CONFIG] AWS load balancer timeout: %s" , loadBalancerCreateTimeout )
260262
261263 By ("building service configuration with annotations" )
@@ -285,7 +287,7 @@ var _ = Describe("[cloud-provider-aws-e2e] loadbalancer", func() {
285287
286288 By ("waiting for AWS load balancer provisioning" )
287289 var err error
288- e2e .svc , err = e2e .LBJig .WaitForLoadBalancer (loadBalancerCreateTimeout )
290+ e2e .svc , err = e2e .LBJig .WaitForLoadBalancer (context . TODO (), loadBalancerCreateTimeout )
289291 // Collect comprehensive debugging information when LoadBalancer provisioning fails
290292 if err != nil {
291293 serviceName := e2e .LBJig .Name
@@ -306,7 +308,7 @@ var _ = Describe("[cloud-provider-aws-e2e] loadbalancer", func() {
306308 framework .Logf ("[AWS] Load balancer provisioned successfully" )
307309
308310 By ("creating backend server pods" )
309- _ , err = e2e .LBJig .Run (e2e .buildReplicationController (tc .requireAffinity ))
311+ _ , err = e2e .LBJig .Run (context . TODO (), e2e .buildReplicationController (tc .requireAffinity ))
310312 if err != nil {
311313 serviceName := e2e .LBJig .Name
312314 if e2e .svc != nil {
@@ -382,21 +384,21 @@ var _ = Describe("[cloud-provider-aws-e2e] loadbalancer", func() {
382384 } else {
383385 By ("testing HTTP connectivity for external/internet-facing load balancer" )
384386 framework .Logf ("[TEST] Running external connectivity test to %s:%d" , ingressAddress , svcPort )
385- e2eservice .TestReachableHTTP (ingressAddress , svcPort , e2eservice .LoadBalancerLagTimeoutAWS )
387+ e2eservice .TestReachableHTTP (context . TODO (), ingressAddress , svcPort , e2eservice .LoadBalancerLagTimeoutAWS )
386388 }
387389 framework .Logf ("[TEST] HTTP connectivity test completed successfully" )
388390
389391 // Update the service to cluster IP
390392 By ("cleaning up: converting service to ClusterIP" )
391- _ , err = e2e .LBJig .UpdateService (func (s * v1.Service ) {
393+ _ , err = e2e .LBJig .UpdateService (context . TODO (), func (s * v1.Service ) {
392394 s .Spec .Type = v1 .ServiceTypeClusterIP
393395 })
394396 framework .ExpectNoError (err )
395397
396398 // Wait for the load balancer to be destroyed asynchronously
397399 By ("cleaning up: waiting for load balancer destruction" )
398400 framework .Logf ("[CLEANUP] Waiting for load balancer destruction" )
399- _ , err = e2e .LBJig .WaitForLoadBalancerDestroy (ingressAddress , svcPort , loadBalancerCreateTimeout )
401+ _ , err = e2e .LBJig .WaitForLoadBalancerDestroy (context . TODO (), ingressAddress , svcPort , loadBalancerCreateTimeout )
400402 framework .ExpectNoError (err )
401403 framework .Logf ("[CLEANUP] Load balancer destroyed successfully" )
402404 })
0 commit comments