@@ -42,10 +42,13 @@ import (
4242 "google.golang.org/protobuf/types/known/wrapperspb"
4343)
4444
45- // TestOutlierDetection tests an xDS configured ClientConn with an Outlier
46- // Detection present in the system which is a logical no-op. An RPC should
47- // proceed as normal.
48- func (s ) TestOutlierDetection (t * testing.T ) {
45+ // TestOutlierDetection_NoopConfig tests the scenario where the Outlier
46+ // Detection feature is enabled on the gRPC client, but it receives no Outlier
47+ // Detection configuration from the management server. This should result in a
48+ // no-op Outlier Detection configuration being used to configure the Outlier
49+ // Detection balancer. This test verifies that an RPC is able to proceed
50+ // normally with this configuration.
51+ func (s ) TestOutlierDetection_NoopConfig (t * testing.T ) {
4952 oldOD := envconfig .XDSOutlierDetection
5053 envconfig .XDSOutlierDetection = true
5154 internal .RegisterOutlierDetectionBalancerForTesting ()
@@ -87,12 +90,12 @@ func (s) TestOutlierDetection(t *testing.T) {
8790 }
8891}
8992
90- // defaultClientResourcesSpecifyingMultipleBackendsAndOutlierDetection returns
91- // xDS resources which correspond to multiple upstreams, corresponding different
92- // backends listening on different localhost:port combinations. The resources
93- // also configure an Outlier Detection Balancer set up with Failure Percentage
94- // Algorithm, which ejects endpoints based on failure rate.
95- func defaultClientResourcesSpecifyingMultipleBackendsAndOutlierDetection (params e2e.ResourceParams , ports []uint32 ) e2e.UpdateOptions {
93+ // defaultClientResourcesMultipleBackendsAndOD returns xDS resources which
94+ // correspond to multiple upstreams, corresponding different backends listening
95+ // on different localhost:port combinations. The resources also configure an
96+ // Outlier Detection Balancer set up with Failure Percentage Algorithm, which
97+ // ejects endpoints based on failure rate.
98+ func defaultClientResourcesMultipleBackendsAndOD (params e2e.ResourceParams , ports []uint32 ) e2e.UpdateOptions {
9699 routeConfigName := "route-" + params .DialTarget
97100 clusterName := "cluster-" + params .DialTarget
98101 endpointsName := "endpoints-" + params .DialTarget
@@ -108,9 +111,7 @@ func defaultClientResourcesSpecifyingMultipleBackendsAndOutlierDetection(params
108111func defaultClusterWithOutlierDetection (clusterName , edsServiceName string , secLevel e2e.SecurityLevel ) * v3clusterpb.Cluster {
109112 cluster := e2e .DefaultCluster (clusterName , edsServiceName , secLevel )
110113 cluster .OutlierDetection = & v3clusterpb.OutlierDetection {
111- Interval : & durationpb.Duration {
112- Nanos : 500000000 ,
113- },
114+ Interval : & durationpb.Duration {Nanos : 50000000 }, // .5 seconds
114115 BaseEjectionTime : & durationpb.Duration {Seconds : 30 },
115116 MaxEjectionTime : & durationpb.Duration {Seconds : 300 },
116117 MaxEjectionPercent : & wrapperspb.UInt32Value {Value : 1 },
@@ -172,7 +173,7 @@ func (s) TestOutlierDetectionWithOutlier(t *testing.T) {
172173 defer cleanup3 ()
173174
174175 const serviceName = "my-service-client-side-xds"
175- resources := defaultClientResourcesSpecifyingMultipleBackendsAndOutlierDetection (e2e.ResourceParams {
176+ resources := defaultClientResourcesMultipleBackendsAndOD (e2e.ResourceParams {
176177 DialTarget : serviceName ,
177178 NodeID : nodeID ,
178179 Host : "localhost" ,
0 commit comments