flaky_network_test.cc
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2019 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
20 
21 #include <algorithm>
22 #include <condition_variable>
23 #include <memory>
24 #include <mutex>
25 #include <random>
26 #include <thread>
27 
28 #include <gtest/gtest.h>
29 
30 #include "absl/memory/memory.h"
31 
32 #include <grpc/grpc.h>
33 #include <grpc/support/alloc.h>
34 #include <grpc/support/atm.h>
35 #include <grpc/support/log.h>
37 #include <grpc/support/time.h>
38 #include <grpcpp/channel.h>
39 #include <grpcpp/client_context.h>
40 #include <grpcpp/create_channel.h>
42 #include <grpcpp/server.h>
43 #include <grpcpp/server_builder.h>
44 
46 #include "src/core/lib/gpr/env.h"
47 #include "src/proto/grpc/testing/echo.grpc.pb.h"
48 #include "test/core/util/port.h"
52 
53 #ifdef GPR_LINUX
54 using grpc::testing::EchoRequest;
55 using grpc::testing::EchoResponse;
56 
57 namespace grpc {
58 namespace testing {
59 namespace {
60 
61 struct TestScenario {
62  TestScenario(const std::string& creds_type, const std::string& content)
63  : credentials_type(creds_type), message_content(content) {}
66 };
67 
68 class FlakyNetworkTest : public ::testing::TestWithParam<TestScenario> {
69  protected:
70  FlakyNetworkTest()
71  : server_host_("grpctest"),
72  interface_("lo:1"),
73  ipv4_address_("10.0.0.1"),
74  netmask_("/32") {}
75 
76  void InterfaceUp() {
77  std::ostringstream cmd;
78  // create interface_ with address ipv4_address_
79  cmd << "ip addr add " << ipv4_address_ << netmask_ << " dev " << interface_;
80  std::system(cmd.str().c_str());
81  }
82 
83  void InterfaceDown() {
84  std::ostringstream cmd;
85  // remove interface_
86  cmd << "ip addr del " << ipv4_address_ << netmask_ << " dev " << interface_;
87  std::system(cmd.str().c_str());
88  }
89 
90  void DNSUp() {
91  std::ostringstream cmd;
92  // Add DNS entry for server_host_ in /etc/hosts
93  cmd << "echo '" << ipv4_address_ << " " << server_host_
94  << "' >> /etc/hosts";
95  std::system(cmd.str().c_str());
96  }
97 
98  void DNSDown() {
99  std::ostringstream cmd;
100  // Remove DNS entry for server_host_ from /etc/hosts
101  // NOTE: we can't do this in one step with sed -i because when we are
102  // running under docker, the file is mounted by docker so we can't change
103  // its inode from within the container (sed -i creates a new file and
104  // replaces the old file, which changes the inode)
105  cmd << "sed '/" << server_host_ << "/d' /etc/hosts > /etc/hosts.orig";
106  std::system(cmd.str().c_str());
107 
108  // clear the stream
109  cmd.str("");
110 
111  cmd << "cat /etc/hosts.orig > /etc/hosts";
112  std::system(cmd.str().c_str());
113  }
114 
115  void DropPackets() {
116  std::ostringstream cmd;
117  // drop packets with src IP = ipv4_address_
118  cmd << "iptables -A INPUT -s " << ipv4_address_ << " -j DROP";
119 
120  std::system(cmd.str().c_str());
121  // clear the stream
122  cmd.str("");
123 
124  // drop packets with dst IP = ipv4_address_
125  cmd << "iptables -A INPUT -d " << ipv4_address_ << " -j DROP";
126  }
127 
128  void RestoreNetwork() {
129  std::ostringstream cmd;
130  // remove iptables rule to drop packets with src IP = ipv4_address_
131  cmd << "iptables -D INPUT -s " << ipv4_address_ << " -j DROP";
132  std::system(cmd.str().c_str());
133  // clear the stream
134  cmd.str("");
135  // remove iptables rule to drop packets with dest IP = ipv4_address_
136  cmd << "iptables -D INPUT -d " << ipv4_address_ << " -j DROP";
137  }
138 
139  void FlakeNetwork() {
140  std::ostringstream cmd;
141  // Emulate a flaky network connection over interface_. Add a delay of 100ms
142  // +/- 20ms, 0.1% packet loss, 1% duplicates and 0.01% corrupt packets.
143  cmd << "tc qdisc replace dev " << interface_
144  << " root netem delay 100ms 20ms distribution normal loss 0.1% "
145  "duplicate "
146  "0.1% corrupt 0.01% ";
147  std::system(cmd.str().c_str());
148  }
149 
150  void UnflakeNetwork() {
151  // Remove simulated network flake on interface_
152  std::ostringstream cmd;
153  cmd << "tc qdisc del dev " << interface_ << " root netem";
154  std::system(cmd.str().c_str());
155  }
156 
157  void NetworkUp() {
158  InterfaceUp();
159  DNSUp();
160  }
161 
162  void NetworkDown() {
163  InterfaceDown();
164  DNSDown();
165  }
166 
167  void SetUp() override {
168  NetworkUp();
169  grpc_init();
170  StartServer();
171  }
172 
173  void TearDown() override {
174  NetworkDown();
175  StopServer();
176  grpc_shutdown();
177  }
178 
179  void StartServer() {
180  // TODO (pjaikumar): Ideally, we should allocate the port dynamically using
181  // grpc_pick_unused_port_or_die(). That doesn't work inside some docker
182  // containers because port_server listens on localhost which maps to
183  // ip6-looopback, but ipv6 support is not enabled by default in docker.
184  port_ = SERVER_PORT;
185 
186  server_ = absl::make_unique<ServerData>(port_, GetParam().credentials_type);
187  server_->Start(server_host_);
188  }
189  void StopServer() { server_->Shutdown(); }
190 
191  std::unique_ptr<grpc::testing::EchoTestService::Stub> BuildStub(
192  const std::shared_ptr<Channel>& channel) {
193  return grpc::testing::EchoTestService::NewStub(channel);
194  }
195 
196  std::shared_ptr<Channel> BuildChannel(
197  const std::string& lb_policy_name,
198  ChannelArguments args = ChannelArguments()) {
199  if (!lb_policy_name.empty()) {
200  args.SetLoadBalancingPolicyName(lb_policy_name);
201  } // else, default to pick first
202  auto channel_creds = GetCredentialsProvider()->GetChannelCredentials(
203  GetParam().credentials_type, &args);
204  std::ostringstream server_address;
205  server_address << server_host_ << ":" << port_;
206  return CreateCustomChannel(server_address.str(), channel_creds, args);
207  }
208 
209  bool SendRpc(
210  const std::unique_ptr<grpc::testing::EchoTestService::Stub>& stub,
211  int timeout_ms = 0, bool wait_for_ready = false) {
212  auto response = absl::make_unique<EchoResponse>();
213  EchoRequest request;
214  auto& msg = GetParam().message_content;
215  request.set_message(msg);
216  ClientContext context;
217  if (timeout_ms > 0) {
219  // Allow an RPC to be canceled (for deadline exceeded) after it has
220  // reached the server.
221  request.mutable_param()->set_skip_cancelled_check(true);
222  }
223  // See https://github.com/grpc/grpc/blob/master/doc/wait-for-ready.md for
224  // details of wait-for-ready semantics
225  if (wait_for_ready) {
227  }
228  Status status = stub->Echo(&context, request, response.get());
229  auto ok = status.ok();
230  if (ok) {
231  gpr_log(GPR_DEBUG, "RPC succeeded");
232  } else {
233  gpr_log(GPR_DEBUG, "RPC failed: %s", status.error_message().c_str());
234  }
235  return ok;
236  }
237 
238  struct ServerData {
239  int port_;
240  const std::string creds_;
241  std::unique_ptr<Server> server_;
243  std::unique_ptr<std::thread> thread_;
244  bool server_ready_ = false;
245 
246  ServerData(int port, const std::string& creds)
247  : port_(port), creds_(creds) {}
248 
249  void Start(const std::string& server_host) {
250  gpr_log(GPR_INFO, "starting server on port %d", port_);
251  std::mutex mu;
252  std::unique_lock<std::mutex> lock(mu);
253  std::condition_variable cond;
254  thread_ = absl::make_unique<std::thread>(
255  std::bind(&ServerData::Serve, this, server_host, &mu, &cond));
256  cond.wait(lock, [this] { return server_ready_; });
257  server_ready_ = false;
258  gpr_log(GPR_INFO, "server startup complete");
259  }
260 
261  void Serve(const std::string& server_host, std::mutex* mu,
262  std::condition_variable* cond) {
263  std::ostringstream server_address;
264  server_address << server_host << ":" << port_;
265  ServerBuilder builder;
266  auto server_creds =
268  builder.AddListeningPort(server_address.str(), server_creds);
269  builder.RegisterService(&service_);
270  server_ = builder.BuildAndStart();
271  std::lock_guard<std::mutex> lock(*mu);
272  server_ready_ = true;
273  cond->notify_one();
274  }
275 
276  void Shutdown() {
278  thread_->join();
279  }
280  };
281 
282  bool WaitForChannelNotReady(Channel* channel, int timeout_seconds = 5) {
283  const gpr_timespec deadline =
286  while ((state = channel->GetState(false /* try_to_connect */)) ==
288  if (!channel->WaitForStateChange(state, deadline)) return false;
289  }
290  return true;
291  }
292 
293  bool WaitForChannelReady(Channel* channel, int timeout_seconds = 5) {
294  const gpr_timespec deadline =
297  while ((state = channel->GetState(true /* try_to_connect */)) !=
299  if (!channel->WaitForStateChange(state, deadline)) return false;
300  }
301  return true;
302  }
303 
304  private:
306  const std::string interface_;
307  const std::string ipv4_address_;
308  const std::string netmask_;
309  std::unique_ptr<grpc::testing::EchoTestService::Stub> stub_;
310  std::unique_ptr<ServerData> server_;
311  const int SERVER_PORT = 32750;
312  int port_;
313 };
314 
315 std::vector<TestScenario> CreateTestScenarios() {
316  std::vector<TestScenario> scenarios;
317  std::vector<std::string> credentials_types;
318  std::vector<std::string> messages;
319 
320  credentials_types.push_back(kInsecureCredentialsType);
322  for (auto sec = sec_list.begin(); sec != sec_list.end(); sec++) {
323  credentials_types.push_back(*sec);
324  }
325 
326  messages.push_back("🖖");
327  for (size_t k = 1; k < GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH / 1024; k *= 32) {
328  std::string big_msg;
329  for (size_t i = 0; i < k * 1024; ++i) {
330  char c = 'a' + (i % 26);
331  big_msg += c;
332  }
333  messages.push_back(big_msg);
334  }
335  for (auto cred = credentials_types.begin(); cred != credentials_types.end();
336  ++cred) {
337  for (auto msg = messages.begin(); msg != messages.end(); msg++) {
338  scenarios.emplace_back(*cred, *msg);
339  }
340  }
341 
342  return scenarios;
343 }
344 
345 INSTANTIATE_TEST_SUITE_P(FlakyNetworkTest, FlakyNetworkTest,
347 
348 // Network interface connected to server flaps
349 TEST_P(FlakyNetworkTest, NetworkTransition) {
350  const int kKeepAliveTimeMs = 1000;
351  const int kKeepAliveTimeoutMs = 1000;
352  ChannelArguments args;
353  args.SetInt(GRPC_ARG_KEEPALIVE_TIME_MS, kKeepAliveTimeMs);
354  args.SetInt(GRPC_ARG_KEEPALIVE_TIMEOUT_MS, kKeepAliveTimeoutMs);
357 
358  auto channel = BuildChannel("pick_first", args);
359  auto stub = BuildStub(channel);
360  // Channel should be in READY state after we send an RPC
362  EXPECT_EQ(channel->GetState(false), GRPC_CHANNEL_READY);
363 
364  std::atomic_bool shutdown{false};
365  std::thread sender = std::thread([this, &stub, &shutdown]() {
366  while (true) {
367  if (shutdown.load()) {
368  return;
369  }
370  SendRpc(stub);
371  std::this_thread::sleep_for(std::chrono::milliseconds(1000));
372  }
373  });
374 
375  // bring down network
376  NetworkDown();
377  EXPECT_TRUE(WaitForChannelNotReady(channel.get()));
378  // bring network interface back up
379  InterfaceUp();
380  std::this_thread::sleep_for(std::chrono::milliseconds(1000));
381  // Restore DNS entry for server
382  DNSUp();
383  EXPECT_TRUE(WaitForChannelReady(channel.get()));
384  EXPECT_EQ(channel->GetState(false), GRPC_CHANNEL_READY);
385  shutdown.store(true);
386  sender.join();
387 }
388 
389 // Traffic to server server is blackholed temporarily with keepalives enabled
390 TEST_P(FlakyNetworkTest, ServerUnreachableWithKeepalive) {
391  const int kKeepAliveTimeMs = 1000;
392  const int kKeepAliveTimeoutMs = 1000;
393  const int kReconnectBackoffMs = 1000;
394  ChannelArguments args;
395  args.SetInt(GRPC_ARG_KEEPALIVE_TIME_MS, kKeepAliveTimeMs);
396  args.SetInt(GRPC_ARG_KEEPALIVE_TIMEOUT_MS, kKeepAliveTimeoutMs);
399  // max time for a connection attempt
400  args.SetInt(GRPC_ARG_MIN_RECONNECT_BACKOFF_MS, kReconnectBackoffMs);
401  // max time between reconnect attempts
402  args.SetInt(GRPC_ARG_MAX_RECONNECT_BACKOFF_MS, kReconnectBackoffMs);
403 
404  gpr_log(GPR_DEBUG, "FlakyNetworkTest.ServerUnreachableWithKeepalive start");
405  auto channel = BuildChannel("pick_first", args);
406  auto stub = BuildStub(channel);
407  // Channel should be in READY state after we send an RPC
409  EXPECT_EQ(channel->GetState(false), GRPC_CHANNEL_READY);
410 
411  std::atomic_bool shutdown{false};
412  std::thread sender = std::thread([this, &stub, &shutdown]() {
413  while (true) {
414  if (shutdown.load()) {
415  return;
416  }
417  SendRpc(stub);
418  std::this_thread::sleep_for(std::chrono::milliseconds(1000));
419  }
420  });
421 
422  // break network connectivity
423  gpr_log(GPR_DEBUG, "Adding iptables rule to drop packets");
424  DropPackets();
425  std::this_thread::sleep_for(std::chrono::milliseconds(10000));
426  EXPECT_TRUE(WaitForChannelNotReady(channel.get()));
427  // bring network interface back up
428  RestoreNetwork();
429  gpr_log(GPR_DEBUG, "Removed iptables rule to drop packets");
430  EXPECT_TRUE(WaitForChannelReady(channel.get()));
431  EXPECT_EQ(channel->GetState(false), GRPC_CHANNEL_READY);
432  shutdown.store(true);
433  sender.join();
434  gpr_log(GPR_DEBUG, "FlakyNetworkTest.ServerUnreachableWithKeepalive end");
435 }
436 
437 //
438 // Traffic to server server is blackholed temporarily with keepalives disabled
439 TEST_P(FlakyNetworkTest, ServerUnreachableNoKeepalive) {
440  auto channel = BuildChannel("pick_first", ChannelArguments());
441  auto stub = BuildStub(channel);
442  // Channel should be in READY state after we send an RPC
444  EXPECT_EQ(channel->GetState(false), GRPC_CHANNEL_READY);
445 
446  // break network connectivity
447  DropPackets();
448 
449  std::thread sender = std::thread([this, &stub]() {
450  // RPC with deadline should timeout
451  EXPECT_FALSE(SendRpc(stub, /*timeout_ms=*/500, /*wait_for_ready=*/true));
452  // RPC without deadline forever until call finishes
453  EXPECT_TRUE(SendRpc(stub, /*timeout_ms=*/0, /*wait_for_ready=*/true));
454  });
455 
456  std::this_thread::sleep_for(std::chrono::milliseconds(2000));
457  // bring network interface back up
458  RestoreNetwork();
459 
460  // wait for RPC to finish
461  sender.join();
462 }
463 
464 // Send RPCs over a flaky network connection
465 TEST_P(FlakyNetworkTest, FlakyNetwork) {
466  const int kKeepAliveTimeMs = 1000;
467  const int kKeepAliveTimeoutMs = 1000;
468  const int kMessageCount = 100;
469  ChannelArguments args;
470  args.SetInt(GRPC_ARG_KEEPALIVE_TIME_MS, kKeepAliveTimeMs);
471  args.SetInt(GRPC_ARG_KEEPALIVE_TIMEOUT_MS, kKeepAliveTimeoutMs);
474 
475  auto channel = BuildChannel("pick_first", args);
476  auto stub = BuildStub(channel);
477  // Channel should be in READY state after we send an RPC
479  EXPECT_EQ(channel->GetState(false), GRPC_CHANNEL_READY);
480 
481  // simulate flaky network (packet loss, corruption and delays)
482  FlakeNetwork();
483  for (int i = 0; i < kMessageCount; ++i) {
484  SendRpc(stub);
485  }
486  // remove network flakiness
487  UnflakeNetwork();
488  EXPECT_EQ(channel->GetState(false), GRPC_CHANNEL_READY);
489 }
490 
491 // Server is shutdown gracefully and restarted. Client keepalives are enabled
492 TEST_P(FlakyNetworkTest, ServerRestartKeepaliveEnabled) {
493  const int kKeepAliveTimeMs = 1000;
494  const int kKeepAliveTimeoutMs = 1000;
495  ChannelArguments args;
496  args.SetInt(GRPC_ARG_KEEPALIVE_TIME_MS, kKeepAliveTimeMs);
497  args.SetInt(GRPC_ARG_KEEPALIVE_TIMEOUT_MS, kKeepAliveTimeoutMs);
500 
501  auto channel = BuildChannel("pick_first", args);
502  auto stub = BuildStub(channel);
503  // Channel should be in READY state after we send an RPC
505  EXPECT_EQ(channel->GetState(false), GRPC_CHANNEL_READY);
506 
507  // server goes down, client should detect server going down and calls should
508  // fail
509  StopServer();
510  EXPECT_TRUE(WaitForChannelNotReady(channel.get()));
512 
513  std::this_thread::sleep_for(std::chrono::milliseconds(1000));
514 
515  // server restarts, calls succeed
516  StartServer();
517  EXPECT_TRUE(WaitForChannelReady(channel.get()));
518  // EXPECT_TRUE(SendRpc(stub));
519 }
520 
521 // Server is shutdown gracefully and restarted. Client keepalives are enabled
522 TEST_P(FlakyNetworkTest, ServerRestartKeepaliveDisabled) {
523  auto channel = BuildChannel("pick_first", ChannelArguments());
524  auto stub = BuildStub(channel);
525  // Channel should be in READY state after we send an RPC
527  EXPECT_EQ(channel->GetState(false), GRPC_CHANNEL_READY);
528 
529  // server sends GOAWAY when it's shutdown, so client attempts to reconnect
530  StopServer();
531  std::this_thread::sleep_for(std::chrono::milliseconds(1000));
532 
533  EXPECT_TRUE(WaitForChannelNotReady(channel.get()));
534 
535  std::this_thread::sleep_for(std::chrono::milliseconds(1000));
536 
537  // server restarts, calls succeed
538  StartServer();
539  EXPECT_TRUE(WaitForChannelReady(channel.get()));
540 }
541 
542 } // namespace
543 } // namespace testing
544 } // namespace grpc
545 #endif // GPR_LINUX
546 
547 int main(int argc, char** argv) {
548  ::testing::InitGoogleTest(&argc, argv);
549  grpc::testing::TestEnvironment env(&argc, argv);
550  auto result = RUN_ALL_TESTS();
551  return result;
552 }
EXPECT_FALSE
#define EXPECT_FALSE(condition)
Definition: bloaty/third_party/googletest/googletest/include/gtest/gtest.h:1970
test_credentials_provider.h
check_grpcio_tools.content
content
Definition: check_grpcio_tools.py:26
_gevent_test_main.result
result
Definition: _gevent_test_main.py:96
GPR_INFO
#define GPR_INFO
Definition: include/grpc/impl/codegen/log.h:56
testing
Definition: aws_request_signer_test.cc:25
grpc::status
auto status
Definition: cpp/client/credentials_test.cc:200
GRPC_CHANNEL_READY
@ GRPC_CHANNEL_READY
Definition: include/grpc/impl/codegen/connectivity_state.h:36
grpc_timeout_seconds_to_deadline
gpr_timespec grpc_timeout_seconds_to_deadline(int64_t time_s)
Definition: test/core/util/test_config.cc:81
log.h
grpc::testing::CredentialsProvider::GetChannelCredentials
virtual std::shared_ptr< ChannelCredentials > GetChannelCredentials(const std::string &type, ChannelArguments *args)=0
stub_
std::unique_ptr< grpc::testing::EchoTestService::Stub > stub_
Definition: client_channel_stress_test.cc:331
port.h
backoff.h
generate.env
env
Definition: generate.py:37
grpc
Definition: grpcpp/alarm.h:33
fix_build_deps.c
list c
Definition: fix_build_deps.py:490
mutex
static uv_mutex_t mutex
Definition: threadpool.c:34
run_interop_tests.timeout_seconds
timeout_seconds
Definition: run_interop_tests.py:1553
grpc::ClientContext::set_wait_for_ready
void set_wait_for_ready(bool wait_for_ready)
Definition: grpcpp/impl/codegen/client_context.h:285
benchmark.request
request
Definition: benchmark.py:77
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
grpc::ClientContext::set_deadline
void set_deadline(const T &deadline)
Definition: grpcpp/impl/codegen/client_context.h:274
health_check_service_interface.h
env.h
time.h
async_greeter_client.stub
stub
Definition: hellostreamingworld/async_greeter_client.py:26
setup.k
k
Definition: third_party/bloaty/third_party/capstone/bindings/python/setup.py:42
server_address
std::string server_address("0.0.0.0:10000")
server_
Server *const server_
Definition: chttp2_server.cc:260
grpc_connectivity_state
grpc_connectivity_state
Definition: include/grpc/impl/codegen/connectivity_state.h:30
test_service_impl.h
testing::TestWithParam
Definition: bloaty/third_party/googletest/googletest/include/gtest/gtest.h:1883
message_content
const std::string message_content
Definition: async_end2end_test.cc:238
grpc::testing::kInsecureCredentialsType
const char kInsecureCredentialsType[]
Definition: test_credentials_provider.h:31
string_util.h
framework.rpc.grpc_channelz.Channel
Channel
Definition: grpc_channelz.py:32
grpc::testing::CredentialsProvider::GetServerCredentials
virtual std::shared_ptr< ServerCredentials > GetServerCredentials(const std::string &type)=0
profile_analyzer.builder
builder
Definition: profile_analyzer.py:159
channel
wrapped_grpc_channel * channel
Definition: src/php/ext/grpc/call.h:33
asyncio_get_stats.args
args
Definition: asyncio_get_stats.py:40
creds_
std::shared_ptr< ChannelCredentials > creds_
Definition: client_lb_end2end_test.cc:523
grpc_timeout_milliseconds_to_deadline
gpr_timespec grpc_timeout_milliseconds_to_deadline(int64_t time_ms)
Definition: test/core/util/test_config.cc:89
gpr_log
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
grpc.h
cond
static uv_cond_t cond
Definition: threadpool.c:33
framework.xds_flags.SERVER_PORT
SERVER_PORT
Definition: xds_flags.py:66
GRPC_ARG_MAX_RECONNECT_BACKOFF_MS
#define GRPC_ARG_MAX_RECONNECT_BACKOFF_MS
Definition: grpc_types.h:261
regen-readme.cmd
cmd
Definition: regen-readme.py:21
channel.h
grpc::testing::INSTANTIATE_TEST_SUITE_P
INSTANTIATE_TEST_SUITE_P(HistogramTestCases, HistogramTest, ::testing::Range< int >(0, GRPC_STATS_HISTOGRAM_COUNT))
GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA
#define GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA
Definition: grpc_types.h:226
scenarios
static const scenario scenarios[]
Definition: test/core/fling/client.cc:141
benchmark::Shutdown
void Shutdown()
Definition: benchmark/src/benchmark.cc:607
RUN_ALL_TESTS
int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_
Definition: bloaty/third_party/googletest/googletest/include/gtest/gtest.h:2471
main
int main(int argc, char **argv)
Definition: flaky_network_test.cc:547
GRPC_ARG_MIN_RECONNECT_BACKOFF_MS
#define GRPC_ARG_MIN_RECONNECT_BACKOFF_MS
Definition: grpc_types.h:259
msg
std::string msg
Definition: client_interceptors_end2end_test.cc:372
GRPC_ARG_KEEPALIVE_TIMEOUT_MS
#define GRPC_ARG_KEEPALIVE_TIMEOUT_MS
Definition: grpc_types.h:244
GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH
#define GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH
Definition: grpc_types.h:504
server_host_
const std::string server_host_
Definition: client_channel_stress_test.cc:329
tests.unit._exit_scenarios.port
port
Definition: _exit_scenarios.py:179
test_config.h
wait_for_ready
bool wait_for_ready
Definition: rls_end2end_test.cc:240
client_context.h
testing::InitGoogleTest
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
Definition: bloaty/third_party/googletest/googletest/src/gtest.cc:6106
http2_server_health_check.server_host
server_host
Definition: http2_server_health_check.py:27
grpc::testing::GetCredentialsProvider
CredentialsProvider * GetCredentialsProvider()
Definition: test_credentials_provider.cc:169
StartServer
void StartServer(JNIEnv *env, jobject obj, jmethodID is_cancelled_mid, int port)
Definition: grpc-helloworld.cc:48
alloc.h
credentials_type
const std::string credentials_type
Definition: async_end2end_test.cc:237
asyncio_get_stats.response
response
Definition: asyncio_get_stats.py:28
grpc::testing::TestEnvironment
Definition: test/core/util/test_config.h:54
grpc::CreateCustomChannel
std::shared_ptr< Channel > CreateCustomChannel(const grpc::string &target, const std::shared_ptr< ChannelCredentials > &creds, const ChannelArguments &args)
timeout_ms
int timeout_ms
Definition: rls_end2end_test.cc:239
grpc::protobuf::util::Status
GRPC_CUSTOM_UTIL_STATUS Status
Definition: include/grpcpp/impl/codegen/config_protobuf.h:93
CreateTestScenarios
std::vector< std::string > CreateTestScenarios()
Definition: time_jump_test.cc:84
ok
bool ok
Definition: async_end2end_test.cc:197
state
Definition: bloaty/third_party/zlib/contrib/blast/blast.c:41
grpc::testing::EXPECT_EQ
EXPECT_EQ(options.token_exchange_service_uri, "https://foo/exchange")
grpc::testing::CredentialsProvider::GetSecureCredentialsTypeList
virtual std::vector< std::string > GetSecureCredentialsTypeList()=0
GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS
#define GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS
Definition: grpc_types.h:247
GPR_DEBUG
#define GPR_DEBUG
Definition: include/grpc/impl/codegen/log.h:55
context
grpc::ClientContext context
Definition: istio_echo_server_lib.cc:61
grpc::testing::TEST_P
TEST_P(HistogramTest, IncHistogram)
Definition: stats_test.cc:87
atm.h
grpc::testing::EXPECT_TRUE
EXPECT_TRUE(grpc::experimental::StsCredentialsOptionsFromJson(minimum_valid_json, &options) .ok())
testing::ValuesIn
internal::ParamGenerator< typename std::iterator_traits< ForwardIterator >::value_type > ValuesIn(ForwardIterator begin, ForwardIterator end)
Definition: bloaty/third_party/googletest/googletest/include/gtest/gtest-param-test.h:297
server.h
gpr_timespec
Definition: gpr_types.h:50
GRPC_ARG_KEEPALIVE_TIME_MS
#define GRPC_ARG_KEEPALIVE_TIME_MS
Definition: grpc_types.h:240
grpc_init
GRPCAPI void grpc_init(void)
Definition: init.cc:146
port_
int port_
Definition: streams_not_seen_test.cc:377
TestServiceImpl
Definition: interop_server.cc:139
grpc::testing::SendRpc
static void SendRpc(grpc::testing::EchoTestService::Stub *stub, int num_rpcs, bool allow_exhaustion, gpr_atm *errors)
Definition: thread_stress_test.cc:277
grpc_shutdown
GRPCAPI void grpc_shutdown(void)
Definition: init.cc:209
thread
static uv_thread_t thread
Definition: test-async-null-cb.c:29
server_builder.h
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
create_channel.h
state
static struct rpc_state state
Definition: bad_server_response_test.cc:87
grpc::testing::mu
static gpr_mu mu
Definition: bm_cq.cc:162
service_
std::unique_ptr< grpc::testing::TestServiceImpl > service_
Definition: end2end_binder_transport_test.cc:71
thread_
std::unique_ptr< std::thread > thread_
Definition: settings_timeout_test.cc:104
port_platform.h


grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:24