|
|
|
@ -35,26 +35,17 @@ |
|
|
|
|
#include <grpcpp/server.h> |
|
|
|
|
#include <grpcpp/server_builder.h> |
|
|
|
|
|
|
|
|
|
#include "src/core/ext/filters/client_channel/lb_policy.h" |
|
|
|
|
#include "src/core/ext/filters/client_channel/lb_policy_registry.h" |
|
|
|
|
#include "src/core/ext/filters/client_channel/parse_address.h" |
|
|
|
|
#include "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h" |
|
|
|
|
#include "src/core/ext/filters/client_channel/server_address.h" |
|
|
|
|
#include "src/core/ext/filters/client_channel/subchannel_index.h" |
|
|
|
|
#include "src/core/lib/backoff/backoff.h" |
|
|
|
|
#include "src/core/lib/channel/channel_args.h" |
|
|
|
|
#include "src/core/lib/channel/channelz.h" |
|
|
|
|
#include "src/core/lib/gpr/env.h" |
|
|
|
|
#include "src/core/lib/gprpp/debug_location.h" |
|
|
|
|
#include "src/core/lib/gprpp/orphanable.h" |
|
|
|
|
#include "src/core/lib/gprpp/ref_counted_ptr.h" |
|
|
|
|
#include "src/core/lib/iomgr/closure.h" |
|
|
|
|
#include "src/core/lib/iomgr/error.h" |
|
|
|
|
#include "src/core/lib/iomgr/tcp_client.h" |
|
|
|
|
#include "src/core/lib/security/credentials/fake/fake_credentials.h" |
|
|
|
|
#include "src/core/lib/transport/connectivity_state.h" |
|
|
|
|
#include "src/core/lib/transport/static_metadata.h" |
|
|
|
|
#include "src/core/lib/transport/status_metadata.h" |
|
|
|
|
#include "src/cpp/client/secure_credentials.h" |
|
|
|
|
#include "src/cpp/server/secure_server_credentials.h" |
|
|
|
|
|
|
|
|
@ -1260,23 +1251,20 @@ class ClientLbInterceptTrailingMetadataTest : public ClientLbEnd2endTest { |
|
|
|
|
int trailers_intercepted_ = 0; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
TEST_F(ClientLbInterceptTrailingMetadataTest, InterceptsRetriesDisabled) { |
|
|
|
|
TEST_F(ClientLbInterceptTrailingMetadataTest, InterceptsRetries) { |
|
|
|
|
const int kNumServers = 1; |
|
|
|
|
const int kNumRpcs = 10; |
|
|
|
|
StartServers(kNumServers); |
|
|
|
|
auto channel = BuildChannel("intercept_trailing_metadata_lb"); |
|
|
|
|
auto stub = BuildStub(channel); |
|
|
|
|
std::vector<int> ports; |
|
|
|
|
for (size_t i = 0; i < servers_.size(); ++i) { |
|
|
|
|
ports.emplace_back(servers_[i]->port_); |
|
|
|
|
} |
|
|
|
|
SetNextResolution(ports); |
|
|
|
|
for (size_t i = 0; i < servers_.size(); ++i) { |
|
|
|
|
SetNextResolution(GetServersPorts()); |
|
|
|
|
for (size_t i = 0; i < kNumRpcs; ++i) { |
|
|
|
|
CheckRpcSendOk(stub, DEBUG_LOCATION); |
|
|
|
|
} |
|
|
|
|
// Check LB policy name for the channel.
|
|
|
|
|
EXPECT_EQ("intercept_trailing_metadata_lb", |
|
|
|
|
channel->GetLoadBalancingPolicyName()); |
|
|
|
|
EXPECT_EQ(kNumServers, trailers_intercepted()); |
|
|
|
|
EXPECT_EQ(kNumRpcs, trailers_intercepted()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|