Browse Source

Merge branch 'master' into vjpai-patch-4

Vijay Pai 4 years ago
parent
commit
fa7640bda1

+ 1 - 1
BUILD

@@ -2630,7 +2630,7 @@ grpc_cc_library_xds(
     alwayslink = 1,
 )
 
-grpc_cc_library(
+grpc_cc_library_xds(
     name = "grpcpp_admin",
     srcs = [
         "src/cpp/server/admin/admin_services.cc",

+ 7 - 22
src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc

@@ -107,17 +107,6 @@ CircuitBreakerCallCounterMap::CallCounter::~CallCounter() {
 
 constexpr char kXdsClusterImpl[] = "xds_cluster_impl_experimental";
 
-// TODO (donnadionne): Check to see if circuit breaking is enabled, this will be
-// removed once circuit breaking feature is fully integrated and enabled by
-// default.
-bool XdsCircuitBreakingEnabled() {
-  char* value = gpr_getenv("GRPC_XDS_EXPERIMENTAL_CIRCUIT_BREAKING");
-  bool parsed_value;
-  bool parse_succeeded = gpr_parse_bool_value(value, &parsed_value);
-  gpr_free(value);
-  return parse_succeeded && parsed_value;
-}
-
 // Config for xDS Cluster Impl LB policy.
 class XdsClusterImplLbConfig : public LoadBalancingPolicy::Config {
  public:
@@ -208,7 +197,6 @@ class XdsClusterImplLb : public LoadBalancingPolicy {
 
    private:
     RefCountedPtr<CircuitBreakerCallCounterMap::CallCounter> call_counter_;
-    bool xds_circuit_breaking_enabled_;
     uint32_t max_concurrent_requests_;
     RefCountedPtr<XdsApi::EdsUpdate::DropConfig> drop_config_;
     RefCountedPtr<XdsClusterDropStats> drop_stats_;
@@ -277,7 +265,6 @@ class XdsClusterImplLb : public LoadBalancingPolicy {
 XdsClusterImplLb::Picker::Picker(XdsClusterImplLb* xds_cluster_impl_lb,
                                  RefCountedPtr<RefCountedPicker> picker)
     : call_counter_(xds_cluster_impl_lb->call_counter_),
-      xds_circuit_breaking_enabled_(XdsCircuitBreakingEnabled()),
       max_concurrent_requests_(
           xds_cluster_impl_lb->config_->max_concurrent_requests()),
       drop_config_(xds_cluster_impl_lb->config_->drop_config()),
@@ -301,15 +288,13 @@ LoadBalancingPolicy::PickResult XdsClusterImplLb::Picker::Pick(
   }
   // Handle circuit breaking.
   uint32_t current = call_counter_->Increment();
-  if (xds_circuit_breaking_enabled_) {
-    // Check and see if we exceeded the max concurrent requests count.
-    if (current >= max_concurrent_requests_) {
-      call_counter_->Decrement();
-      if (drop_stats_ != nullptr) drop_stats_->AddUncategorizedDrops();
-      PickResult result;
-      result.type = PickResult::PICK_COMPLETE;
-      return result;
-    }
+  // Check and see if we exceeded the max concurrent requests count.
+  if (current >= max_concurrent_requests_) {
+    call_counter_->Decrement();
+    if (drop_stats_ != nullptr) drop_stats_->AddUncategorizedDrops();
+    PickResult result;
+    result.type = PickResult::PICK_COMPLETE;
+    return result;
   }
   // If we're not dropping the call, we should always have a child picker.
   if (picker_ == nullptr) {  // Should never happen.

+ 26 - 28
src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc

@@ -366,35 +366,33 @@ XdsResolver::XdsConfigSelector::XdsConfigSelector(
     }
   }
   // Populate filter list.
-  if (XdsFaultInjectionEnabled()) {
-    bool found_router = false;
-    for (const auto& http_filter :
-         resolver_->current_listener_.http_connection_manager.http_filters) {
-      // Stop at the router filter.  It's a no-op for us, and we ignore
-      // anything that may come after it, for compatibility with Envoy.
-      if (http_filter.config.config_proto_type_name ==
-          kXdsHttpRouterFilterConfigName) {
-        found_router = true;
-        break;
-      }
-      // Find filter.  This is guaranteed to succeed, because it's checked
-      // at config validation time in the XdsApi code.
-      const XdsHttpFilterImpl* filter_impl =
-          XdsHttpFilterRegistry::GetFilterForType(
-              http_filter.config.config_proto_type_name);
-      GPR_ASSERT(filter_impl != nullptr);
-      // Add C-core filter to list.
-      filters_.push_back(filter_impl->channel_filter());
-    }
-    // For compatibility with Envoy, if the router filter is not
-    // configured, we fail all RPCs.
-    if (!found_router) {
-      filter_error_ = grpc_error_set_int(
-          GRPC_ERROR_CREATE_FROM_STATIC_STRING(
-              "no xDS HTTP router filter configured"),
-          GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
-      filters_.push_back(&grpc_lame_filter);
+  bool found_router = false;
+  for (const auto& http_filter :
+       resolver_->current_listener_.http_connection_manager.http_filters) {
+    // Stop at the router filter.  It's a no-op for us, and we ignore
+    // anything that may come after it, for compatibility with Envoy.
+    if (http_filter.config.config_proto_type_name ==
+        kXdsHttpRouterFilterConfigName) {
+      found_router = true;
+      break;
     }
+    // Find filter.  This is guaranteed to succeed, because it's checked
+    // at config validation time in the XdsApi code.
+    const XdsHttpFilterImpl* filter_impl =
+        XdsHttpFilterRegistry::GetFilterForType(
+            http_filter.config.config_proto_type_name);
+    GPR_ASSERT(filter_impl != nullptr);
+    // Add C-core filter to list.
+    filters_.push_back(filter_impl->channel_filter());
+  }
+  // For compatibility with Envoy, if the router filter is not
+  // configured, we fail all RPCs.
+  if (!found_router) {
+    filter_error_ =
+        grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+                               "no xDS HTTP router filter configured"),
+                           GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
+    filters_.push_back(&grpc_lame_filter);
   }
 }
 

+ 85 - 114
src/core/ext/xds/xds_api.cc

@@ -100,17 +100,6 @@
 
 namespace grpc_core {
 
-// TODO(donnadionne): Check to see if timeout is enabled, this will be
-// removed once timeout feature is fully integration-tested and enabled by
-// default.
-bool XdsTimeoutEnabled() {
-  char* value = gpr_getenv("GRPC_XDS_EXPERIMENTAL_ENABLE_TIMEOUT");
-  bool parsed_value;
-  bool parse_succeeded = gpr_parse_bool_value(value, &parsed_value);
-  gpr_free(value);
-  return parse_succeeded && parsed_value;
-}
-
 // TODO(donnadionne): Check to see if cluster types aggregate_cluster and
 // logical_dns are enabled, this will be
 // removed once the cluster types are fully integration-tested and enabled by
@@ -146,16 +135,6 @@ bool XdsSecurityEnabled() {
   return parse_succeeded && parsed_value;
 }
 
-// TODO(lidiz): This will be removed once the fault injection feature is
-// fully integration-tested and enabled by default.
-bool XdsFaultInjectionEnabled() {
-  char* value = gpr_getenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
-  bool parsed_value;
-  bool parse_succeeded = gpr_parse_bool_value(value, &parsed_value);
-  gpr_free(value);
-  return parse_succeeded && parsed_value;
-}
-
 //
 // XdsApi::Route::HashPolicy
 //
@@ -1501,8 +1480,7 @@ grpc_error* RouteActionParse(const EncodingContext& context,
       cluster.weight = google_protobuf_UInt32Value_value(weight);
       if (cluster.weight == 0) continue;
       sum_of_weights += cluster.weight;
-      if ((XdsSecurityEnabled() || XdsFaultInjectionEnabled()) &&
-          context.use_v3) {
+      if (context.use_v3) {
         grpc_error* error = ParseTypedPerFilterConfig<
             envoy_config_route_v3_WeightedCluster_ClusterWeight,
             envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry>(
@@ -1527,7 +1505,7 @@ grpc_error* RouteActionParse(const EncodingContext& context,
     // No cluster or weighted_clusters found in RouteAction, ignore this route.
     *ignore_route = true;
   }
-  if (XdsTimeoutEnabled() && !*ignore_route) {
+  if (!*ignore_route) {
     const envoy_config_route_v3_RouteAction_MaxStreamDuration*
         max_stream_duration =
             envoy_config_route_v3_RouteAction_max_stream_duration(route_action);
@@ -1664,8 +1642,7 @@ grpc_error* RouteConfigParse(
       return GRPC_ERROR_CREATE_FROM_STATIC_STRING("VirtualHost has no domains");
     }
     // Parse typed_per_filter_config.
-    if ((XdsSecurityEnabled() || XdsFaultInjectionEnabled()) &&
-        context.use_v3) {
+    if (context.use_v3) {
       grpc_error* error = ParseTypedPerFilterConfig<
           envoy_config_route_v3_VirtualHost,
           envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry>(
@@ -1709,8 +1686,7 @@ grpc_error* RouteConfigParse(
       error = RouteActionParse(context, routes[j], &route, &ignore_route);
       if (error != GRPC_ERROR_NONE) return error;
       if (ignore_route) continue;
-      if ((XdsSecurityEnabled() || XdsFaultInjectionEnabled()) &&
-          context.use_v3) {
+      if (context.use_v3) {
         grpc_error* error = ParseTypedPerFilterConfig<
             envoy_config_route_v3_Route,
             envoy_config_route_v3_Route_TypedPerFilterConfigEntry>(
@@ -1849,99 +1825,94 @@ grpc_error* HttpConnectionManagerParse(
     bool is_v2,
     XdsApi::LdsUpdate::HttpConnectionManager* http_connection_manager) {
   MaybeLogHttpConnectionManager(context, http_connection_manager_proto);
-  if (XdsTimeoutEnabled()) {
-    // Obtain max_stream_duration from Http Protocol Options.
-    const envoy_config_core_v3_HttpProtocolOptions* options =
-        envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_common_http_protocol_options(
-            http_connection_manager_proto);
-    if (options != nullptr) {
-      const google_protobuf_Duration* duration =
-          envoy_config_core_v3_HttpProtocolOptions_max_stream_duration(options);
-      if (duration != nullptr) {
-        http_connection_manager->http_max_stream_duration.seconds =
-            google_protobuf_Duration_seconds(duration);
-        http_connection_manager->http_max_stream_duration.nanos =
-            google_protobuf_Duration_nanos(duration);
-      }
+  // Obtain max_stream_duration from Http Protocol Options.
+  const envoy_config_core_v3_HttpProtocolOptions* options =
+      envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_common_http_protocol_options(
+          http_connection_manager_proto);
+  if (options != nullptr) {
+    const google_protobuf_Duration* duration =
+        envoy_config_core_v3_HttpProtocolOptions_max_stream_duration(options);
+    if (duration != nullptr) {
+      http_connection_manager->http_max_stream_duration.seconds =
+          google_protobuf_Duration_seconds(duration);
+      http_connection_manager->http_max_stream_duration.nanos =
+          google_protobuf_Duration_nanos(duration);
     }
   }
   // Parse filters.
-  if (XdsSecurityEnabled() || XdsFaultInjectionEnabled()) {
-    if (!is_v2) {
-      size_t num_filters = 0;
-      const auto* http_filters =
-          envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_http_filters(
-              http_connection_manager_proto, &num_filters);
-      std::set<absl::string_view> names_seen;
-      for (size_t i = 0; i < num_filters; ++i) {
-        const auto* http_filter = http_filters[i];
-        absl::string_view name = UpbStringToAbsl(
-            envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_name(
-                http_filter));
-        if (name.empty()) {
-          return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
-              absl::StrCat("empty filter name at index ", i).c_str());
-        }
-        if (names_seen.find(name) != names_seen.end()) {
-          return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
-              absl::StrCat("duplicate HTTP filter name: ", name).c_str());
-        }
-        names_seen.insert(name);
-        const bool is_optional =
-            envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_is_optional(
-                http_filter);
-        const google_protobuf_Any* any =
-            envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_typed_config(
-                http_filter);
-        if (any == nullptr) {
-          if (is_optional) continue;
-          return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
-              absl::StrCat("no filter config specified for filter name ", name)
-                  .c_str());
-        }
-        absl::string_view filter_type;
-        grpc_error* error =
-            ExtractHttpFilterTypeName(context, any, &filter_type);
-        if (error != GRPC_ERROR_NONE) return error;
-        const XdsHttpFilterImpl* filter_impl =
-            XdsHttpFilterRegistry::GetFilterForType(filter_type);
-        if (filter_impl == nullptr) {
-          if (is_optional) continue;
-          return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
-              absl::StrCat("no filter registered for config type ", filter_type)
-                  .c_str());
-        }
-        if ((is_client && !filter_impl->IsSupportedOnClients()) ||
-            (!is_client && !filter_impl->IsSupportedOnServers())) {
-          if (is_optional) continue;
-          return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
-              absl::StrFormat("Filter %s is not supported on %s", filter_type,
-                              is_client ? "clients" : "servers")
-                  .c_str());
-        }
-        absl::StatusOr<XdsHttpFilterImpl::FilterConfig> filter_config =
-            filter_impl->GenerateFilterConfig(google_protobuf_Any_value(any),
-                                              context.arena);
-        if (!filter_config.ok()) {
-          return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
-              absl::StrCat(
-                  "filter config for type ", filter_type,
-                  " failed to parse: ", filter_config.status().ToString())
-                  .c_str());
-        }
-        http_connection_manager->http_filters.emplace_back(
-            XdsApi::LdsUpdate::HttpConnectionManager::HttpFilter{
-                std::string(name), std::move(*filter_config)});
+  if (!is_v2) {
+    size_t num_filters = 0;
+    const auto* http_filters =
+        envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_http_filters(
+            http_connection_manager_proto, &num_filters);
+    std::set<absl::string_view> names_seen;
+    for (size_t i = 0; i < num_filters; ++i) {
+      const auto* http_filter = http_filters[i];
+      absl::string_view name = UpbStringToAbsl(
+          envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_name(
+              http_filter));
+      if (name.empty()) {
+        return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+            absl::StrCat("empty filter name at index ", i).c_str());
+      }
+      if (names_seen.find(name) != names_seen.end()) {
+        return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+            absl::StrCat("duplicate HTTP filter name: ", name).c_str());
+      }
+      names_seen.insert(name);
+      const bool is_optional =
+          envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_is_optional(
+              http_filter);
+      const google_protobuf_Any* any =
+          envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_typed_config(
+              http_filter);
+      if (any == nullptr) {
+        if (is_optional) continue;
+        return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+            absl::StrCat("no filter config specified for filter name ", name)
+                .c_str());
+      }
+      absl::string_view filter_type;
+      grpc_error* error = ExtractHttpFilterTypeName(context, any, &filter_type);
+      if (error != GRPC_ERROR_NONE) return error;
+      const XdsHttpFilterImpl* filter_impl =
+          XdsHttpFilterRegistry::GetFilterForType(filter_type);
+      if (filter_impl == nullptr) {
+        if (is_optional) continue;
+        return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+            absl::StrCat("no filter registered for config type ", filter_type)
+                .c_str());
+      }
+      if ((is_client && !filter_impl->IsSupportedOnClients()) ||
+          (!is_client && !filter_impl->IsSupportedOnServers())) {
+        if (is_optional) continue;
+        return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+            absl::StrFormat("Filter %s is not supported on %s", filter_type,
+                            is_client ? "clients" : "servers")
+                .c_str());
+      }
+      absl::StatusOr<XdsHttpFilterImpl::FilterConfig> filter_config =
+          filter_impl->GenerateFilterConfig(google_protobuf_Any_value(any),
+                                            context.arena);
+      if (!filter_config.ok()) {
+        return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+            absl::StrCat(
+                "filter config for type ", filter_type,
+                " failed to parse: ", filter_config.status().ToString())
+                .c_str());
       }
-    } else {
-      // If using a v2 config, we just hard-code a list containing only the
-      // router filter without actually looking at the config.  This ensures
-      // that the right thing happens in the xds resolver without having
-      // to expose whether the resource we received was v2 or v3.
       http_connection_manager->http_filters.emplace_back(
           XdsApi::LdsUpdate::HttpConnectionManager::HttpFilter{
-              "router", {kXdsHttpRouterFilterConfigName, Json()}});
+              std::string(name), std::move(*filter_config)});
     }
+  } else {
+    // If using a v2 config, we just hard-code a list containing only the
+    // router filter without actually looking at the config.  This ensures
+    // that the right thing happens in the xds resolver without having
+    // to expose whether the resource we received was v2 or v3.
+    http_connection_manager->http_filters.emplace_back(
+        XdsApi::LdsUpdate::HttpConnectionManager::HttpFilter{
+            "router", {kXdsHttpRouterFilterConfigName, Json()}});
   }
   if (is_client) {
     // Found inlined route_config. Parse it to find the cluster_name.

+ 0 - 4
src/core/ext/xds/xds_api.h

@@ -47,10 +47,6 @@ namespace grpc_core {
 // default.
 bool XdsSecurityEnabled();
 
-// TODO(lidiz): This will be removed once the fault injection feature is
-// fully integration-tested and enabled by default.
-bool XdsFaultInjectionEnabled();
-
 class XdsClient;
 
 class XdsApi {

+ 1 - 1
test/cpp/end2end/BUILD

@@ -874,7 +874,7 @@ grpc_cc_test(
     ],
 )
 
-grpc_cc_test(
+grpc_cc_test_xds(
     name = "admin_services_end2end_test",
     srcs = ["admin_services_end2end_test.cc"],
     external_deps = [

+ 5 - 1
test/cpp/end2end/admin_services_end2end_test.cc

@@ -21,7 +21,6 @@
 
 #include "absl/strings/str_cat.h"
 
-#include <grpcpp/ext/admin_services.h>
 #include <grpcpp/ext/proto_server_reflection_plugin.h>
 #include <grpcpp/grpcpp.h>
 
@@ -29,6 +28,9 @@
 #include "test/core/util/port.h"
 #include "test/core/util/test_config.h"
 
+#ifndef DISABLED_XDS_PROTO_IN_CC
+#include <grpcpp/ext/admin_services.h>
+
 namespace grpc {
 namespace testing {
 
@@ -95,6 +97,8 @@ TEST_F(AdminServicesTest, XdsDisabled) {
 }  // namespace testing
 }  // namespace grpc
 
+#endif  // DISABLED_XDS_PROTO_IN_CC
+
 int main(int argc, char** argv) {
   grpc::testing::TestEnvironment env(argc, argv);
   ::testing::InitGoogleTest(&argc, argv);

+ 0 - 250
test/cpp/end2end/xds_end2end_test.cc

@@ -2864,7 +2864,6 @@ TEST_P(XdsResolverOnlyTest, DefaultRouteSpecifiesSlashPrefix) {
 }
 
 TEST_P(XdsResolverOnlyTest, CircuitBreaking) {
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_CIRCUIT_BREAKING", "true");
   constexpr size_t kMaxConcurrentRequests = 10;
   SetNextResolution({});
   SetNextResolutionForLbChannelAllBalancers();
@@ -2906,11 +2905,9 @@ TEST_P(XdsResolverOnlyTest, CircuitBreaking) {
   // Make sure RPCs go to the correct backend:
   EXPECT_EQ(kMaxConcurrentRequests + 1,
             backends_[0]->backend_service()->request_count());
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_CIRCUIT_BREAKING");
 }
 
 TEST_P(XdsResolverOnlyTest, CircuitBreakingMultipleChannelsShareCallCounter) {
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_CIRCUIT_BREAKING", "true");
   constexpr size_t kMaxConcurrentRequests = 10;
   // Populate new EDS resources.
   AdsServiceImpl::EdsResourceArgs args({
@@ -2962,45 +2959,6 @@ TEST_P(XdsResolverOnlyTest, CircuitBreakingMultipleChannelsShareCallCounter) {
   // Make sure RPCs go to the correct backend:
   EXPECT_EQ(kMaxConcurrentRequests + 1,
             backends_[0]->backend_service()->request_count());
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_CIRCUIT_BREAKING");
-}
-
-TEST_P(XdsResolverOnlyTest, CircuitBreakingDisabled) {
-  constexpr size_t kMaxConcurrentRequests = 10;
-  SetNextResolution({});
-  SetNextResolutionForLbChannelAllBalancers();
-  // Populate new EDS resources.
-  AdsServiceImpl::EdsResourceArgs args({
-      {"locality0", GetBackendPorts(0, 1)},
-  });
-  balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args));
-  // Update CDS resource to set max concurrent request.
-  CircuitBreakers circuit_breaks;
-  Cluster cluster = default_cluster_;
-  auto* threshold = cluster.mutable_circuit_breakers()->add_thresholds();
-  threshold->set_priority(RoutingPriority::DEFAULT);
-  threshold->mutable_max_requests()->set_value(kMaxConcurrentRequests);
-  balancers_[0]->ads_service()->SetCdsResource(cluster);
-  // Send exactly max_concurrent_requests long RPCs.
-  LongRunningRpc rpcs[kMaxConcurrentRequests];
-  for (size_t i = 0; i < kMaxConcurrentRequests; ++i) {
-    rpcs[i].StartRpc(stub_.get());
-  }
-  // Wait for all RPCs to be in flight.
-  while (backends_[0]->backend_service()->RpcsWaitingForClientCancel() <
-         kMaxConcurrentRequests) {
-    gpr_sleep_until(gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
-                                 gpr_time_from_micros(1 * 1000, GPR_TIMESPAN)));
-  }
-  // Sending a RPC now should not fail as circuit breaking is disabled.
-  Status status = SendRpc();
-  EXPECT_TRUE(status.ok());
-  for (size_t i = 0; i < kMaxConcurrentRequests; ++i) {
-    rpcs[i].CancelRpc();
-  }
-  // Make sure RPCs go to the correct backend:
-  EXPECT_EQ(kMaxConcurrentRequests + 1,
-            backends_[0]->backend_service()->request_count());
 }
 
 TEST_P(XdsResolverOnlyTest, MultipleChannelsShareXdsClient) {
@@ -3309,23 +3267,8 @@ TEST_P(LdsTest, MultipleBadResources) {
                            ": Listener has neither address nor ApiListener"))));
 }
 
-// TODO(roth): Remove this test when we remove the
-// GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION environment variable guard.
-TEST_P(LdsTest, HttpFiltersEnabled) {
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
-  SetNextResolutionForLbChannelAllBalancers();
-  AdsServiceImpl::EdsResourceArgs args({
-      {"locality0", GetBackendPorts()},
-  });
-  balancers_[0]->ads_service()->SetEdsResource(
-      BuildEdsResource(args, DefaultEdsServiceName()));
-  WaitForAllBackends();
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
-}
-
 // Tests that we ignore filters after the router filter.
 TEST_P(LdsTest, IgnoresHttpFiltersAfterRouterFilter) {
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   SetNextResolutionForLbChannelAllBalancers();
   auto listener = default_listener_;
   HttpConnectionManager http_connection_manager;
@@ -3344,12 +3287,10 @@ TEST_P(LdsTest, IgnoresHttpFiltersAfterRouterFilter) {
   balancers_[0]->ads_service()->SetEdsResource(
       BuildEdsResource(args, DefaultEdsServiceName()));
   WaitForAllBackends();
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 // Test that we fail RPCs if there is no router filter.
 TEST_P(LdsTest, FailRpcsIfNoHttpRouterFilter) {
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   SetNextResolutionForLbChannelAllBalancers();
   auto listener = default_listener_;
   HttpConnectionManager http_connection_manager;
@@ -3375,12 +3316,10 @@ TEST_P(LdsTest, FailRpcsIfNoHttpRouterFilter) {
   const auto response_state =
       balancers_[0]->ads_service()->lds_response_state();
   EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::ACKED);
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 // Test that we NACK empty filter names.
 TEST_P(LdsTest, RejectsEmptyHttpFilterName) {
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   auto listener = default_listener_;
   HttpConnectionManager http_connection_manager;
   listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
@@ -3402,12 +3341,10 @@ TEST_P(LdsTest, RejectsEmptyHttpFilterName) {
   EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
   EXPECT_THAT(response_state.error_message,
               ::testing::HasSubstr("empty filter name at index 1"));
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 // Test that we NACK duplicate HTTP filter names.
 TEST_P(LdsTest, RejectsDuplicateHttpFilterName) {
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   auto listener = default_listener_;
   HttpConnectionManager http_connection_manager;
   listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
@@ -3429,12 +3366,10 @@ TEST_P(LdsTest, RejectsDuplicateHttpFilterName) {
   EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
   EXPECT_THAT(response_state.error_message,
               ::testing::HasSubstr("duplicate HTTP filter name: router"));
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 // Test that we NACK unknown filter types.
 TEST_P(LdsTest, RejectsUnknownHttpFilterType) {
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   auto listener = default_listener_;
   HttpConnectionManager http_connection_manager;
   listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
@@ -3458,12 +3393,10 @@ TEST_P(LdsTest, RejectsUnknownHttpFilterType) {
   EXPECT_THAT(response_state.error_message,
               ::testing::HasSubstr("no filter registered for config type "
                                    "envoy.config.listener.v3.Listener"));
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 // Test that we ignore optional unknown filter types.
 TEST_P(LdsTest, IgnoresOptionalUnknownHttpFilterType) {
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   auto listener = default_listener_;
   HttpConnectionManager http_connection_manager;
   listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
@@ -3484,12 +3417,10 @@ TEST_P(LdsTest, IgnoresOptionalUnknownHttpFilterType) {
   WaitForAllBackends();
   EXPECT_EQ(balancers_[0]->ads_service()->lds_response_state().state,
             AdsServiceImpl::ResponseState::ACKED);
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 // Test that we NACK filters without configs.
 TEST_P(LdsTest, RejectsHttpFilterWithoutConfig) {
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   auto listener = default_listener_;
   HttpConnectionManager http_connection_manager;
   listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
@@ -3512,12 +3443,10 @@ TEST_P(LdsTest, RejectsHttpFilterWithoutConfig) {
   EXPECT_THAT(response_state.error_message,
               ::testing::HasSubstr(
                   "no filter config specified for filter name unknown"));
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 // Test that we ignore optional filters without configs.
 TEST_P(LdsTest, IgnoresOptionalHttpFilterWithoutConfig) {
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   auto listener = default_listener_;
   HttpConnectionManager http_connection_manager;
   listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
@@ -3537,12 +3466,10 @@ TEST_P(LdsTest, IgnoresOptionalHttpFilterWithoutConfig) {
   WaitForAllBackends();
   EXPECT_EQ(balancers_[0]->ads_service()->lds_response_state().state,
             AdsServiceImpl::ResponseState::ACKED);
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 // Test that we NACK unparseable filter configs.
 TEST_P(LdsTest, RejectsUnparseableHttpFilterType) {
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   auto listener = default_listener_;
   HttpConnectionManager http_connection_manager;
   listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
@@ -3570,12 +3497,10 @@ TEST_P(LdsTest, RejectsUnparseableHttpFilterType) {
       ::testing::HasSubstr(
           "filter config for type "
           "envoy.extensions.filters.http.router.v3.Router failed to parse"));
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 // Test that we NACK HTTP filters unsupported on client-side.
 TEST_P(LdsTest, RejectsHttpFiltersNotSupportedOnClients) {
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   auto listener = default_listener_;
   HttpConnectionManager http_connection_manager;
   listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
@@ -3601,12 +3526,10 @@ TEST_P(LdsTest, RejectsHttpFiltersNotSupportedOnClients) {
       response_state.error_message,
       ::testing::HasSubstr("Filter grpc.testing.server_only_http_filter is not "
                            "supported on clients"));
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 // Test that we ignore optional HTTP filters unsupported on client-side.
 TEST_P(LdsTest, IgnoresOptionalHttpFiltersNotSupportedOnClients) {
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   auto listener = default_listener_;
   HttpConnectionManager http_connection_manager;
   listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
@@ -3629,7 +3552,6 @@ TEST_P(LdsTest, IgnoresOptionalHttpFiltersNotSupportedOnClients) {
   WaitForBackend(0);
   EXPECT_EQ(balancers_[0]->ads_service()->lds_response_state().state,
             AdsServiceImpl::ResponseState::ACKED);
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 using LdsV2Test = LdsTest;
@@ -3639,7 +3561,6 @@ using LdsV2Test = LdsTest;
 // the server sending v2 resources when the client requests v3, so this
 // just tests a pure v2 setup.  When we have time, fix this.
 TEST_P(LdsV2Test, IgnoresHttpFilters) {
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   auto listener = default_listener_;
   HttpConnectionManager http_connection_manager;
   listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
@@ -3657,7 +3578,6 @@ TEST_P(LdsV2Test, IgnoresHttpFilters) {
       BuildEdsResource(args, DefaultEdsServiceName()));
   SetNextResolutionForLbChannelAllBalancers();
   CheckRpcSendOk();
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 using LdsRdsTest = BasicTest;
@@ -5131,7 +5051,6 @@ TEST_P(LdsRdsTest, XdsRoutingClusterUpdateClustersWithPickingDelays) {
 }
 
 TEST_P(LdsRdsTest, XdsRoutingApplyXdsTimeout) {
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_ENABLE_TIMEOUT", "true");
   const int64_t kTimeoutMillis = 500;
   const int64_t kTimeoutNano = kTimeoutMillis * 1000000;
   const int64_t kTimeoutGrpcTimeoutHeaderMaxSecond = 1;
@@ -5264,89 +5183,9 @@ TEST_P(LdsRdsTest, XdsRoutingApplyXdsTimeout) {
   t0 = NowFromCycleCounter();
   EXPECT_GE(t0, t1);
   EXPECT_LT(t0, t2);
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_ENABLE_TIMEOUT");
-}
-
-TEST_P(LdsRdsTest, XdsRoutingXdsTimeoutDisabled) {
-  const int64_t kTimeoutMillis = 500;
-  const int64_t kTimeoutNano = kTimeoutMillis * 1000000;
-  const int64_t kTimeoutGrpcTimeoutHeaderMaxSecond = 1;
-  const int64_t kTimeoutApplicationSecond = 4;
-  SetNextResolution({});
-  SetNextResolutionForLbChannelAllBalancers();
-  // Populate new EDS resources.
-  AdsServiceImpl::EdsResourceArgs args({
-      {"locality0", {grpc_pick_unused_port_or_die()}},
-  });
-  balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args));
-  RouteConfiguration new_route_config = default_route_config_;
-  // route 1: Set grpc_timeout_header_max of 1.5
-  auto* route1 = new_route_config.mutable_virtual_hosts(0)->mutable_routes(0);
-  auto* max_stream_duration =
-      route1->mutable_route()->mutable_max_stream_duration();
-  auto* duration = max_stream_duration->mutable_grpc_timeout_header_max();
-  duration->set_seconds(kTimeoutGrpcTimeoutHeaderMaxSecond);
-  duration->set_nanos(kTimeoutNano);
-  SetRouteConfiguration(0, new_route_config);
-  // Test grpc_timeout_header_max of 1.5 seconds is not applied
-  gpr_timespec t0 = gpr_now(GPR_CLOCK_MONOTONIC);
-  gpr_timespec est_timeout_time = gpr_time_add(
-      t0, gpr_time_from_millis(
-              kTimeoutGrpcTimeoutHeaderMaxSecond * 1000 + kTimeoutMillis,
-              GPR_TIMESPAN));
-  CheckRpcSendFailure(1,
-                      RpcOptions()
-                          .set_rpc_service(SERVICE_ECHO1)
-                          .set_rpc_method(METHOD_ECHO1)
-                          .set_wait_for_ready(true)
-                          .set_timeout_ms(kTimeoutApplicationSecond * 1000),
-                      StatusCode::DEADLINE_EXCEEDED);
-  gpr_timespec timeout_time = gpr_now(GPR_CLOCK_MONOTONIC);
-  EXPECT_GT(gpr_time_cmp(timeout_time, est_timeout_time), 0);
-}
-
-TEST_P(LdsRdsTest, XdsRoutingHttpTimeoutDisabled) {
-  const int64_t kTimeoutMillis = 500;
-  const int64_t kTimeoutNano = kTimeoutMillis * 1000000;
-  const int64_t kTimeoutHttpMaxStreamDurationSecond = 3;
-  const int64_t kTimeoutApplicationSecond = 4;
-  SetNextResolution({});
-  SetNextResolutionForLbChannelAllBalancers();
-  // Populate new EDS resources.
-  AdsServiceImpl::EdsResourceArgs args({
-      {"locality0", {grpc_pick_unused_port_or_die()}},
-  });
-  // Construct listener.
-  auto listener = default_listener_;
-  HttpConnectionManager http_connection_manager;
-  listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
-      &http_connection_manager);
-  // Set up HTTP max_stream_duration of 3.5 seconds
-  auto* duration =
-      http_connection_manager.mutable_common_http_protocol_options()
-          ->mutable_max_stream_duration();
-  duration->set_seconds(kTimeoutHttpMaxStreamDurationSecond);
-  duration->set_nanos(kTimeoutNano);
-  listener.mutable_api_listener()->mutable_api_listener()->PackFrom(
-      http_connection_manager);
-  SetListenerAndRouteConfiguration(0, std::move(listener),
-                                   default_route_config_);
-  // Test http_stream_duration of 3.5 seconds is not applied
-  auto t0 = gpr_now(GPR_CLOCK_MONOTONIC);
-  auto est_timeout_time = gpr_time_add(
-      t0, gpr_time_from_millis(
-              kTimeoutHttpMaxStreamDurationSecond * 1000 + kTimeoutMillis,
-              GPR_TIMESPAN));
-  CheckRpcSendFailure(1,
-                      RpcOptions().set_wait_for_ready(true).set_timeout_ms(
-                          kTimeoutApplicationSecond * 1000),
-                      StatusCode::DEADLINE_EXCEEDED);
-  auto timeout_time = gpr_now(GPR_CLOCK_MONOTONIC);
-  EXPECT_GT(gpr_time_cmp(timeout_time, est_timeout_time), 0);
 }
 
 TEST_P(LdsRdsTest, XdsRoutingApplyApplicationTimeoutWhenXdsTimeoutExplicit0) {
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_ENABLE_TIMEOUT", "true");
   const int64_t kTimeoutNano = 500000000;
   const int64_t kTimeoutMaxStreamDurationSecond = 2;
   const int64_t kTimeoutHttpMaxStreamDurationSecond = 3;
@@ -5448,11 +5287,9 @@ TEST_P(LdsRdsTest, XdsRoutingApplyApplicationTimeoutWhenXdsTimeoutExplicit0) {
       system_clock::now() - t0);
   EXPECT_GT(ellapsed_nano_seconds.count(),
             kTimeoutApplicationSecond * 1000000000);
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_ENABLE_TIMEOUT");
 }
 
 TEST_P(LdsRdsTest, XdsRoutingApplyApplicationTimeoutWhenHttpTimeoutExplicit0) {
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_ENABLE_TIMEOUT", "true");
   const int64_t kTimeoutApplicationSecond = 4;
   SetNextResolution({});
   SetNextResolutionForLbChannelAllBalancers();
@@ -5487,13 +5324,11 @@ TEST_P(LdsRdsTest, XdsRoutingApplyApplicationTimeoutWhenHttpTimeoutExplicit0) {
                                                            t0);
   EXPECT_GT(ellapsed_nano_seconds.count(),
             kTimeoutApplicationSecond * 1000000000);
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_ENABLE_TIMEOUT");
 }
 
 // Test to ensure application-specified deadline won't be affected when
 // the xDS config does not specify a timeout.
 TEST_P(LdsRdsTest, XdsRoutingWithOnlyApplicationTimeout) {
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_ENABLE_TIMEOUT", "true");
   const int64_t kTimeoutApplicationSecond = 4;
   SetNextResolution({});
   SetNextResolutionForLbChannelAllBalancers();
@@ -5512,7 +5347,6 @@ TEST_P(LdsRdsTest, XdsRoutingWithOnlyApplicationTimeout) {
                                                            t0);
   EXPECT_GT(ellapsed_nano_seconds.count(),
             kTimeoutApplicationSecond * 1000000000);
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_ENABLE_TIMEOUT");
 }
 
 TEST_P(LdsRdsTest, XdsRoutingHeadersMatching) {
@@ -5917,7 +5751,6 @@ TEST_P(LdsRdsTest, XdsRoutingChangeRoutesWithoutChangingClusters) {
 // Test that we NACK unknown filter types in VirtualHost.
 TEST_P(LdsRdsTest, RejectsUnknownHttpFilterTypeInVirtualHost) {
   if (GetParam().use_v2()) return;  // Filters supported in v3 only.
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   RouteConfiguration route_config = default_route_config_;
   auto* per_filter_config =
       route_config.mutable_virtual_hosts(0)->mutable_typed_per_filter_config();
@@ -5935,13 +5768,11 @@ TEST_P(LdsRdsTest, RejectsUnknownHttpFilterTypeInVirtualHost) {
   EXPECT_THAT(response_state.error_message,
               ::testing::HasSubstr("no filter registered for config type "
                                    "envoy.config.listener.v3.Listener"));
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 // Test that we ignore optional unknown filter types in VirtualHost.
 TEST_P(LdsRdsTest, IgnoresOptionalUnknownHttpFilterTypeInVirtualHost) {
   if (GetParam().use_v2()) return;  // Filters supported in v3 only.
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   RouteConfiguration route_config = default_route_config_;
   auto* per_filter_config =
       route_config.mutable_virtual_hosts(0)->mutable_typed_per_filter_config();
@@ -5960,13 +5791,11 @@ TEST_P(LdsRdsTest, IgnoresOptionalUnknownHttpFilterTypeInVirtualHost) {
   WaitForAllBackends();
   EXPECT_EQ(RouteConfigurationResponseState(0).state,
             AdsServiceImpl::ResponseState::ACKED);
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 // Test that we NACK filters without configs in VirtualHost.
 TEST_P(LdsRdsTest, RejectsHttpFilterWithoutConfigInVirtualHost) {
   if (GetParam().use_v2()) return;  // Filters supported in v3 only.
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   RouteConfiguration route_config = default_route_config_;
   auto* per_filter_config =
       route_config.mutable_virtual_hosts(0)->mutable_typed_per_filter_config();
@@ -5984,13 +5813,11 @@ TEST_P(LdsRdsTest, RejectsHttpFilterWithoutConfigInVirtualHost) {
   EXPECT_THAT(response_state.error_message,
               ::testing::HasSubstr(
                   "no filter config specified for filter name unknown"));
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 // Test that we NACK filters without configs in FilterConfig in VirtualHost.
 TEST_P(LdsRdsTest, RejectsHttpFilterWithoutConfigInFilterConfigInVirtualHost) {
   if (GetParam().use_v2()) return;  // Filters supported in v3 only.
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   RouteConfiguration route_config = default_route_config_;
   auto* per_filter_config =
       route_config.mutable_virtual_hosts(0)->mutable_typed_per_filter_config();
@@ -6009,13 +5836,11 @@ TEST_P(LdsRdsTest, RejectsHttpFilterWithoutConfigInFilterConfigInVirtualHost) {
   EXPECT_THAT(response_state.error_message,
               ::testing::HasSubstr(
                   "no filter config specified for filter name unknown"));
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 // Test that we ignore optional filters without configs in VirtualHost.
 TEST_P(LdsRdsTest, IgnoresOptionalHttpFilterWithoutConfigInVirtualHost) {
   if (GetParam().use_v2()) return;  // Filters supported in v3 only.
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   RouteConfiguration route_config = default_route_config_;
   auto* per_filter_config =
       route_config.mutable_virtual_hosts(0)->mutable_typed_per_filter_config();
@@ -6033,13 +5858,11 @@ TEST_P(LdsRdsTest, IgnoresOptionalHttpFilterWithoutConfigInVirtualHost) {
   WaitForAllBackends();
   EXPECT_EQ(RouteConfigurationResponseState(0).state,
             AdsServiceImpl::ResponseState::ACKED);
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 // Test that we NACK unparseable filter types in VirtualHost.
 TEST_P(LdsRdsTest, RejectsUnparseableHttpFilterTypeInVirtualHost) {
   if (GetParam().use_v2()) return;  // Filters supported in v3 only.
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   RouteConfiguration route_config = default_route_config_;
   auto* per_filter_config =
       route_config.mutable_virtual_hosts(0)->mutable_typed_per_filter_config();
@@ -6058,13 +5881,11 @@ TEST_P(LdsRdsTest, RejectsUnparseableHttpFilterTypeInVirtualHost) {
   EXPECT_THAT(
       response_state.error_message,
       ::testing::HasSubstr("router filter does not support config override"));
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 // Test that we NACK unknown filter types in Route.
 TEST_P(LdsRdsTest, RejectsUnknownHttpFilterTypeInRoute) {
   if (GetParam().use_v2()) return;  // Filters supported in v3 only.
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   RouteConfiguration route_config = default_route_config_;
   auto* per_filter_config = route_config.mutable_virtual_hosts(0)
                                 ->mutable_routes(0)
@@ -6083,13 +5904,11 @@ TEST_P(LdsRdsTest, RejectsUnknownHttpFilterTypeInRoute) {
   EXPECT_THAT(response_state.error_message,
               ::testing::HasSubstr("no filter registered for config type "
                                    "envoy.config.listener.v3.Listener"));
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 // Test that we ignore optional unknown filter types in Route.
 TEST_P(LdsRdsTest, IgnoresOptionalUnknownHttpFilterTypeInRoute) {
   if (GetParam().use_v2()) return;  // Filters supported in v3 only.
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   RouteConfiguration route_config = default_route_config_;
   auto* per_filter_config = route_config.mutable_virtual_hosts(0)
                                 ->mutable_routes(0)
@@ -6109,13 +5928,11 @@ TEST_P(LdsRdsTest, IgnoresOptionalUnknownHttpFilterTypeInRoute) {
   WaitForAllBackends();
   EXPECT_EQ(RouteConfigurationResponseState(0).state,
             AdsServiceImpl::ResponseState::ACKED);
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 // Test that we NACK filters without configs in Route.
 TEST_P(LdsRdsTest, RejectsHttpFilterWithoutConfigInRoute) {
   if (GetParam().use_v2()) return;  // Filters supported in v3 only.
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   RouteConfiguration route_config = default_route_config_;
   auto* per_filter_config = route_config.mutable_virtual_hosts(0)
                                 ->mutable_routes(0)
@@ -6134,13 +5951,11 @@ TEST_P(LdsRdsTest, RejectsHttpFilterWithoutConfigInRoute) {
   EXPECT_THAT(response_state.error_message,
               ::testing::HasSubstr(
                   "no filter config specified for filter name unknown"));
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 // Test that we NACK filters without configs in FilterConfig in Route.
 TEST_P(LdsRdsTest, RejectsHttpFilterWithoutConfigInFilterConfigInRoute) {
   if (GetParam().use_v2()) return;  // Filters supported in v3 only.
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   RouteConfiguration route_config = default_route_config_;
   auto* per_filter_config = route_config.mutable_virtual_hosts(0)
                                 ->mutable_routes(0)
@@ -6160,13 +5975,11 @@ TEST_P(LdsRdsTest, RejectsHttpFilterWithoutConfigInFilterConfigInRoute) {
   EXPECT_THAT(response_state.error_message,
               ::testing::HasSubstr(
                   "no filter config specified for filter name unknown"));
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 // Test that we ignore optional filters without configs in Route.
 TEST_P(LdsRdsTest, IgnoresOptionalHttpFilterWithoutConfigInRoute) {
   if (GetParam().use_v2()) return;  // Filters supported in v3 only.
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   RouteConfiguration route_config = default_route_config_;
   auto* per_filter_config = route_config.mutable_virtual_hosts(0)
                                 ->mutable_routes(0)
@@ -6185,13 +5998,11 @@ TEST_P(LdsRdsTest, IgnoresOptionalHttpFilterWithoutConfigInRoute) {
   WaitForAllBackends();
   EXPECT_EQ(RouteConfigurationResponseState(0).state,
             AdsServiceImpl::ResponseState::ACKED);
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 // Test that we NACK unparseable filter types in Route.
 TEST_P(LdsRdsTest, RejectsUnparseableHttpFilterTypeInRoute) {
   if (GetParam().use_v2()) return;  // Filters supported in v3 only.
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   RouteConfiguration route_config = default_route_config_;
   auto* per_filter_config = route_config.mutable_virtual_hosts(0)
                                 ->mutable_routes(0)
@@ -6211,13 +6022,11 @@ TEST_P(LdsRdsTest, RejectsUnparseableHttpFilterTypeInRoute) {
   EXPECT_THAT(
       response_state.error_message,
       ::testing::HasSubstr("router filter does not support config override"));
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 // Test that we NACK unknown filter types in ClusterWeight.
 TEST_P(LdsRdsTest, RejectsUnknownHttpFilterTypeInClusterWeight) {
   if (GetParam().use_v2()) return;  // Filters supported in v3 only.
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   RouteConfiguration route_config = default_route_config_;
   auto* cluster_weight = route_config.mutable_virtual_hosts(0)
                              ->mutable_routes(0)
@@ -6241,13 +6050,11 @@ TEST_P(LdsRdsTest, RejectsUnknownHttpFilterTypeInClusterWeight) {
   EXPECT_THAT(response_state.error_message,
               ::testing::HasSubstr("no filter registered for config type "
                                    "envoy.config.listener.v3.Listener"));
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 // Test that we ignore optional unknown filter types in ClusterWeight.
 TEST_P(LdsRdsTest, IgnoresOptionalUnknownHttpFilterTypeInClusterWeight) {
   if (GetParam().use_v2()) return;  // Filters supported in v3 only.
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   RouteConfiguration route_config = default_route_config_;
   auto* cluster_weight = route_config.mutable_virtual_hosts(0)
                              ->mutable_routes(0)
@@ -6272,13 +6079,11 @@ TEST_P(LdsRdsTest, IgnoresOptionalUnknownHttpFilterTypeInClusterWeight) {
   WaitForAllBackends();
   EXPECT_EQ(RouteConfigurationResponseState(0).state,
             AdsServiceImpl::ResponseState::ACKED);
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 // Test that we NACK filters without configs in ClusterWeight.
 TEST_P(LdsRdsTest, RejectsHttpFilterWithoutConfigInClusterWeight) {
   if (GetParam().use_v2()) return;  // Filters supported in v3 only.
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   RouteConfiguration route_config = default_route_config_;
   auto* cluster_weight = route_config.mutable_virtual_hosts(0)
                              ->mutable_routes(0)
@@ -6302,14 +6107,12 @@ TEST_P(LdsRdsTest, RejectsHttpFilterWithoutConfigInClusterWeight) {
   EXPECT_THAT(response_state.error_message,
               ::testing::HasSubstr(
                   "no filter config specified for filter name unknown"));
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 // Test that we NACK filters without configs in FilterConfig in ClusterWeight.
 TEST_P(LdsRdsTest,
        RejectsHttpFilterWithoutConfigInFilterConfigInClusterWeight) {
   if (GetParam().use_v2()) return;  // Filters supported in v3 only.
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   RouteConfiguration route_config = default_route_config_;
   auto* cluster_weight = route_config.mutable_virtual_hosts(0)
                              ->mutable_routes(0)
@@ -6334,13 +6137,11 @@ TEST_P(LdsRdsTest,
   EXPECT_THAT(response_state.error_message,
               ::testing::HasSubstr(
                   "no filter config specified for filter name unknown"));
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 // Test that we ignore optional filters without configs in ClusterWeight.
 TEST_P(LdsRdsTest, IgnoresOptionalHttpFilterWithoutConfigInClusterWeight) {
   if (GetParam().use_v2()) return;  // Filters supported in v3 only.
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   RouteConfiguration route_config = default_route_config_;
   auto* cluster_weight = route_config.mutable_virtual_hosts(0)
                              ->mutable_routes(0)
@@ -6364,13 +6165,11 @@ TEST_P(LdsRdsTest, IgnoresOptionalHttpFilterWithoutConfigInClusterWeight) {
   WaitForAllBackends();
   EXPECT_EQ(RouteConfigurationResponseState(0).state,
             AdsServiceImpl::ResponseState::ACKED);
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 // Test that we NACK unparseable filter types in ClusterWeight.
 TEST_P(LdsRdsTest, RejectsUnparseableHttpFilterTypeInClusterWeight) {
   if (GetParam().use_v2()) return;  // Filters supported in v3 only.
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   RouteConfiguration route_config = default_route_config_;
   auto* cluster_weight = route_config.mutable_virtual_hosts(0)
                              ->mutable_routes(0)
@@ -6395,7 +6194,6 @@ TEST_P(LdsRdsTest, RejectsUnparseableHttpFilterTypeInClusterWeight) {
   EXPECT_THAT(
       response_state.error_message,
       ::testing::HasSubstr("router filter does not support config override"));
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 using CdsTest = BasicTest;
@@ -7456,7 +7254,6 @@ TEST_P(XdsEnabledServerTest, UnsupportedL4Filter) {
 
 TEST_P(XdsEnabledServerTest, UnsupportedHttpFilter) {
   // Set env var to enable filters parsing.
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   Listener listener;
   listener.set_name(
       absl::StrCat("grpc/server?xds.resource.listening_address=",
@@ -7487,12 +7284,10 @@ TEST_P(XdsEnabledServerTest, UnsupportedHttpFilter) {
   EXPECT_THAT(response_state.error_message,
               ::testing::HasSubstr("no filter registered for config type "
                                    "grpc.testing.unsupported_http_filter"));
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 TEST_P(XdsEnabledServerTest, HttpFilterNotSupportedOnServer) {
   // Set env var to enable filters parsing.
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   Listener listener;
   listener.set_name(
       absl::StrCat("grpc/server?xds.resource.listening_address=",
@@ -7524,13 +7319,11 @@ TEST_P(XdsEnabledServerTest, HttpFilterNotSupportedOnServer) {
       response_state.error_message,
       ::testing::HasSubstr("Filter grpc.testing.client_only_http_filter is not "
                            "supported on servers"));
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 TEST_P(XdsEnabledServerTest,
        HttpFilterNotSupportedOnServerIgnoredWhenOptional) {
   // Set env var to enable filters parsing.
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   Listener listener;
   listener.set_name(
       absl::StrCat("grpc/server?xds.resource.listening_address=",
@@ -7556,7 +7349,6 @@ TEST_P(XdsEnabledServerTest,
   const auto response_state =
       balancers_[0]->ads_service()->lds_response_state();
   EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::ACKED);
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 // Verify that a mismatch of listening address results in "not serving" status.
@@ -9613,7 +9405,6 @@ class FaultInjectionTest : public XdsEnd2endTest {
 
 // Test to ensure the most basic fault injection config works.
 TEST_P(FaultInjectionTest, XdsFaultInjectionAlwaysAbort) {
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   const uint32_t kAbortPercentagePerHundred = 100;
   SetNextResolution({});
   SetNextResolutionForLbChannelAllBalancers();
@@ -9629,36 +9420,10 @@ TEST_P(FaultInjectionTest, XdsFaultInjectionAlwaysAbort) {
   // Fire several RPCs, and expect all of them to be aborted.
   CheckRpcSendFailure(5, RpcOptions().set_wait_for_ready(true),
                       StatusCode::ABORTED);
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
-}
-
-// Without the env, the fault injection won't be enabled.
-TEST_P(FaultInjectionTest, XdsFaultInjectionWithoutEnv) {
-  const uint32_t kAbortPercentagePerHundred = 100;
-  SetNextResolution({});
-  SetNextResolutionForLbChannelAllBalancers();
-  // Create an EDS resource
-  AdsServiceImpl::EdsResourceArgs args({
-      {"locality0", GetBackendPorts()},
-  });
-  balancers_[0]->ads_service()->SetEdsResource(
-      BuildEdsResource(args, DefaultEdsServiceName()));
-  // Construct the fault injection filter config
-  HTTPFault http_fault;
-  auto* abort_percentage = http_fault.mutable_abort()->mutable_percentage();
-  abort_percentage->set_numerator(kAbortPercentagePerHundred);
-  abort_percentage->set_denominator(FractionalPercent::HUNDRED);
-  http_fault.mutable_abort()->set_grpc_status(
-      static_cast<uint32_t>(StatusCode::ABORTED));
-  // Config fault injection via different setup
-  SetFilterConfig(http_fault);
-  // Fire several RPCs, and expect all of them to pass.
-  CheckRpcSendOk(5, RpcOptions().set_wait_for_ready(true));
 }
 
 // Without the listener config, the fault injection won't be enabled.
 TEST_P(FaultInjectionTest, XdsFaultInjectionWithoutListenerFilter) {
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   const uint32_t kAbortPercentagePerHundred = 100;
   SetNextResolution({});
   SetNextResolutionForLbChannelAllBalancers();
@@ -9681,11 +9446,9 @@ TEST_P(FaultInjectionTest, XdsFaultInjectionWithoutListenerFilter) {
   SetListenerAndRouteConfiguration(0, default_listener_, route);
   // Fire several RPCs, and expect all of them to be pass.
   CheckRpcSendOk(5, RpcOptions().set_wait_for_ready(true));
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 TEST_P(FaultInjectionTest, XdsFaultInjectionPercentageAbort) {
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   const size_t kNumRpcs = 100;
   const uint32_t kAbortPercentagePerHundred = 50;
   const double kAbortRate = kAbortPercentagePerHundred / 100.0;
@@ -9720,11 +9483,9 @@ TEST_P(FaultInjectionTest, XdsFaultInjectionPercentageAbort) {
   EXPECT_THAT(seen_abort_rate,
               ::testing::AllOf(::testing::Ge(kAbortRate - kErrorTolerance),
                                ::testing::Le(kAbortRate + kErrorTolerance)));
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 TEST_P(FaultInjectionTest, XdsFaultInjectionPercentageAbortViaHeaders) {
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   const size_t kNumRpcs = 100;
   const uint32_t kAbortPercentageCap = 100;
   const uint32_t kAbortPercentage = 50;
@@ -9763,13 +9524,11 @@ TEST_P(FaultInjectionTest, XdsFaultInjectionPercentageAbortViaHeaders) {
   EXPECT_THAT(seen_abort_rate,
               ::testing::AllOf(::testing::Ge(kAbortRate - kErrorTolerance),
                                ::testing::Le(kAbortRate + kErrorTolerance)));
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 // TODO(lidiz) reduce the error tolerance to a lower level without dramatically
 // increase the duration of fault injection tests.
 TEST_P(FaultInjectionTest, XdsFaultInjectionPercentageDelay) {
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   const size_t kNumRpcs = 100;
   const uint32_t kFixedDelaySeconds = 100;
   const uint32_t kRpcTimeoutMilliseconds = 10;  // 10 ms
@@ -9808,11 +9567,9 @@ TEST_P(FaultInjectionTest, XdsFaultInjectionPercentageDelay) {
   EXPECT_THAT(seen_delay_rate,
               ::testing::AllOf(::testing::Ge(kDelayRate - kErrorTolerance),
                                ::testing::Le(kDelayRate + kErrorTolerance)));
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 TEST_P(FaultInjectionTest, XdsFaultInjectionPercentageDelayViaHeaders) {
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   const size_t kNumRpcs = 100;
   const uint32_t kFixedDelayMilliseconds = 100000;  // 100 seconds
   const uint32_t kRpcTimeoutMilliseconds = 10;      // 10 ms
@@ -9854,11 +9611,9 @@ TEST_P(FaultInjectionTest, XdsFaultInjectionPercentageDelayViaHeaders) {
   EXPECT_THAT(seen_delay_rate,
               ::testing::AllOf(::testing::Ge(kDelayRate - kErrorTolerance),
                                ::testing::Le(kDelayRate + kErrorTolerance)));
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 TEST_P(FaultInjectionTest, XdsFaultInjectionAlwaysDelayPercentageAbort) {
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   const size_t kNumRpcs = 100;
   const uint32_t kAbortPercentagePerHundred = 50;
   const double kAbortRate = kAbortPercentagePerHundred / 100.0;
@@ -9902,7 +9657,6 @@ TEST_P(FaultInjectionTest, XdsFaultInjectionAlwaysDelayPercentageAbort) {
   EXPECT_THAT(seen_abort_rate,
               ::testing::AllOf(::testing::Ge(kAbortRate - kErrorTolerance),
                                ::testing::Le(kAbortRate + kErrorTolerance)));
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 // This test and the above test apply different denominators to delay and abort.
@@ -9910,7 +9664,6 @@ TEST_P(FaultInjectionTest, XdsFaultInjectionAlwaysDelayPercentageAbort) {
 // in our code.
 TEST_P(FaultInjectionTest,
        XdsFaultInjectionAlwaysDelayPercentageAbortSwitchDenominator) {
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   const size_t kNumRpcs = 100;
   const uint32_t kAbortPercentagePerMillion = 500000;
   const double kAbortRate = kAbortPercentagePerMillion / 1000000.0;
@@ -9954,11 +9707,9 @@ TEST_P(FaultInjectionTest,
   EXPECT_THAT(seen_abort_rate,
               ::testing::AllOf(::testing::Ge(kAbortRate - kErrorTolerance),
                                ::testing::Le(kAbortRate + kErrorTolerance)));
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 TEST_P(FaultInjectionTest, XdsFaultInjectionMaxFault) {
-  gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
   const uint32_t kMaxFault = 10;
   const uint32_t kNumRpcs = 30;  // kNumRpcs should be bigger than kMaxFault
   const uint32_t kRpcTimeoutMs = 2000;     // 2 seconds
@@ -10004,7 +9755,6 @@ TEST_P(FaultInjectionTest, XdsFaultInjectionMaxFault) {
   EXPECT_EQ(kMaxFault, num_delayed);
   // Other RPCs should be ok.
   EXPECT_EQ(kNumRpcs - kMaxFault, num_ok);
-  gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
 }
 
 class BootstrapContentsFromEnvVarTest : public XdsEnd2endTest {