@@ -863,10 +863,14 @@ func (config *NetworkingTestConfig) setup(ctx context.Context, selector map[stri
863
863
}
864
864
865
865
ginkgo .By ("Waiting for NodePort service to expose endpoint" )
866
- err = framework .WaitForServiceEndpointsNum (ctx , config .f .ClientSet , config .Namespace , nodePortServiceName , len (config .EndpointPods ), time .Second , wait .ForeverTestTimeout )
866
+ numEndpoints := len (config .EndpointPods )
867
+ if config .DualStackEnabled {
868
+ numEndpoints = 2 * len (config .EndpointPods )
869
+ }
870
+ err = framework .WaitForServiceEndpointsNum (ctx , config .f .ClientSet , config .Namespace , nodePortServiceName , numEndpoints , time .Second , wait .ForeverTestTimeout )
867
871
framework .ExpectNoError (err , "failed to validate endpoints for service %s in namespace: %s" , nodePortServiceName , config .Namespace )
868
872
ginkgo .By ("Waiting for Session Affinity service to expose endpoint" )
869
- err = framework .WaitForServiceEndpointsNum (ctx , config .f .ClientSet , config .Namespace , sessionAffinityServiceName , len ( config . EndpointPods ) , time .Second , wait .ForeverTestTimeout )
873
+ err = framework .WaitForServiceEndpointsNum (ctx , config .f .ClientSet , config .Namespace , sessionAffinityServiceName , numEndpoints , time .Second , wait .ForeverTestTimeout )
870
874
framework .ExpectNoError (err , "failed to validate endpoints for service %s in namespace: %s" , sessionAffinityServiceName , config .Namespace )
871
875
}
872
876
@@ -916,7 +920,11 @@ func (config *NetworkingTestConfig) DeleteNetProxyPod(ctx context.Context) {
916
920
framework .Failf ("Failed to delete %s pod: %v" , pod .Name , err )
917
921
}
918
922
// wait for endpoint being removed.
919
- err = framework .WaitForServiceEndpointsNum (ctx , config .f .ClientSet , config .Namespace , nodePortServiceName , len (config .EndpointPods ), time .Second , wait .ForeverTestTimeout )
923
+ numEndpoints := len (config .EndpointPods )
924
+ if config .DualStackEnabled {
925
+ numEndpoints = 2 * len (config .EndpointPods )
926
+ }
927
+ err = framework .WaitForServiceEndpointsNum (ctx , config .f .ClientSet , config .Namespace , nodePortServiceName , numEndpoints , time .Second , wait .ForeverTestTimeout )
920
928
if err != nil {
921
929
framework .Failf ("Failed to remove endpoint from service: %s" , nodePortServiceName )
922
930
}
0 commit comments