test_service_impl.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2016 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 
19 #ifndef GRPC_TEST_CPP_END2END_TEST_SERVICE_IMPL_H
20 #define GRPC_TEST_CPP_END2END_TEST_SERVICE_IMPL_H
21 
22 #include <condition_variable>
23 #include <memory>
24 #include <mutex>
25 #include <string>
26 #include <thread>
27 
28 #include <gtest/gtest.h>
29 
30 #include <grpc/grpc.h>
31 #include <grpc/support/log.h>
32 #include <grpcpp/alarm.h>
34 #include <grpcpp/server_context.h>
35 
36 #include "src/proto/grpc/testing/echo.grpc.pb.h"
38 
39 namespace grpc {
40 namespace testing {
41 
43 const char* const kServerResponseStreamsToSend = "server_responses_to_send";
44 const char* const kServerTryCancelRequest = "server_try_cancel";
45 const char* const kClientTryCancelRequest = "client_try_cancel";
46 const char* const kDebugInfoTrailerKey = "debug-info-bin";
47 const char* const kServerFinishAfterNReads = "server_finish_after_n_reads";
48 const char* const kServerUseCoalescingApi = "server_use_coalescing_api";
49 const char* const kCheckClientInitialMetadataKey = "custom_client_metadata";
50 const char* const kCheckClientInitialMetadataVal = "Value for client metadata";
51 
52 typedef enum {
58 
59 namespace internal {
60 // When echo_deadline is requested, deadline seen in the ServerContext is set in
61 // the response in seconds.
62 void MaybeEchoDeadline(ServerContextBase* context, const EchoRequest* request,
63  EchoResponse* response);
64 
66  const std::string& expected_transport_security_type,
67  const std::string& expected_client_identity);
68 
69 // Returns the number of pairs in metadata that exactly match the given
70 // key-value pair. Returns -1 if the pair wasn't found.
72  const std::multimap<grpc::string_ref, grpc::string_ref>& metadata,
73  const std::string& key, const std::string& value);
74 
76  const char* key,
77  const std::multimap<grpc::string_ref, grpc::string_ref>& metadata,
78  int default_value);
79 
81  const char* key,
82  const std::multimap<grpc::string_ref, grpc::string_ref>& metadata,
83  int default_value);
84 
86 } // namespace internal
87 
89  public:
91  std::unique_lock<std::mutex> lock(mu_);
92  cv_rpc_started_.wait(lock, [this] { return rpc_started_; });
93  }
95  std::unique_lock<std::mutex> lock(mu_);
96  cv_server_continue_.wait(lock, [this] { return server_should_continue_; });
97  }
99  std::unique_lock<std::mutex> lock(mu_);
100  rpc_started_ = true;
101  cv_rpc_started_.notify_one();
102  }
104  std::unique_lock<std::mutex> lock(mu_);
106  cv_server_continue_.notify_one();
107  }
108 
109  private:
111  std::condition_variable cv_rpc_started_;
112  bool rpc_started_ /* GUARDED_BY(mu_) */ = false;
113  std::condition_variable cv_server_continue_;
114  bool server_should_continue_ /* GUARDED_BY(mu_) */ = false;
115 };
116 
117 template <typename RpcService>
118 class TestMultipleServiceImpl : public RpcService {
119  public:
121  explicit TestMultipleServiceImpl(const std::string& host)
122  : signal_client_(false), host_(new std::string(host)) {}
123 
124  Status Echo(ServerContext* context, const EchoRequest* request,
125  EchoResponse* response) {
126  if (request->has_param() &&
127  request->param().server_notify_client_when_started()) {
130  }
131 
132  // A bit of sleep to make sure that short deadline tests fail
133  if (request->has_param() && request->param().server_sleep_us() > 0) {
136  gpr_time_from_micros(request->param().server_sleep_us(),
137  GPR_TIMESPAN)));
138  }
139 
140  if (request->has_param() && request->param().server_die()) {
141  gpr_log(GPR_ERROR, "The request should not reach application handler.");
142  GPR_ASSERT(0);
143  }
144  if (request->has_param() && request->param().has_expected_error()) {
145  const auto& error = request->param().expected_error();
146  return Status(static_cast<StatusCode>(error.code()),
147  error.error_message(), error.binary_error_details());
148  }
149  int server_try_cancel = internal::GetIntValueFromMetadata(
150  kServerTryCancelRequest, context->client_metadata(), DO_NOT_CANCEL);
151  if (server_try_cancel > DO_NOT_CANCEL) {
152  // Since this is a unary RPC, by the time this server handler is called,
153  // the 'request' message is already read from the client. So the scenarios
154  // in server_try_cancel don't make much sense. Just cancel the RPC as long
155  // as server_try_cancel is not DO_NOT_CANCEL
157  return Status::CANCELLED;
158  }
159 
160  response->set_message(request->message());
162  if (host_) {
163  response->mutable_param()->set_host(*host_);
164  } else if (request->has_param() &&
165  request->param().echo_host_from_authority_header()) {
166  auto authority = context->ExperimentalGetAuthority();
167  std::string authority_str(authority.data(), authority.size());
168  response->mutable_param()->set_host(std::move(authority_str));
169  }
170  if (request->has_param() && request->param().client_cancel_after_us()) {
171  {
172  std::unique_lock<std::mutex> lock(mu_);
173  signal_client_ = true;
175  }
176  while (!context->IsCancelled()) {
179  gpr_time_from_micros(request->param().client_cancel_after_us(),
180  GPR_TIMESPAN)));
181  }
182  {
183  std::unique_lock<std::mutex> lock(mu_);
185  }
186  return Status::CANCELLED;
187  } else if (request->has_param() &&
188  request->param().server_cancel_after_us()) {
191  gpr_time_from_micros(request->param().server_cancel_after_us(),
192  GPR_TIMESPAN)));
193  return Status::CANCELLED;
194  } else if (!request->has_param() ||
195  !request->param().skip_cancelled_check()) {
196  EXPECT_FALSE(context->IsCancelled());
197  }
198 
199  if (request->has_param() && request->param().echo_metadata_initially()) {
200  const std::multimap<grpc::string_ref, grpc::string_ref>& client_metadata =
201  context->client_metadata();
202  for (const auto& metadatum : client_metadata) {
203  context->AddInitialMetadata(ToString(metadatum.first),
204  ToString(metadatum.second));
205  }
206  }
207 
208  if (request->has_param() && request->param().echo_metadata()) {
209  const std::multimap<grpc::string_ref, grpc::string_ref>& client_metadata =
210  context->client_metadata();
211  for (const auto& metadatum : client_metadata) {
212  context->AddTrailingMetadata(ToString(metadatum.first),
213  ToString(metadatum.second));
214  }
215  // Terminate rpc with error and debug info in trailer.
216  if (request->param().debug_info().stack_entries_size() ||
217  !request->param().debug_info().detail().empty()) {
218  std::string serialized_debug_info =
219  request->param().debug_info().SerializeAsString();
220  context->AddTrailingMetadata(kDebugInfoTrailerKey,
221  serialized_debug_info);
222  return Status::CANCELLED;
223  }
224  }
225  if (request->has_param() &&
226  (request->param().expected_client_identity().length() > 0 ||
227  request->param().check_auth_context())) {
229  context, request->param().expected_transport_security_type(),
230  request->param().expected_client_identity());
231  }
232  if (request->has_param() &&
233  request->param().response_message_length() > 0) {
234  response->set_message(
235  std::string(request->param().response_message_length(), '\0'));
236  }
237  if (request->has_param() && request->param().echo_peer()) {
238  response->mutable_param()->set_peer(context->peer());
239  }
240  return Status::OK;
241  }
242 
243  Status Echo1(ServerContext* context, const EchoRequest* request,
244  EchoResponse* response) {
245  return Echo(context, request, response);
246  }
247 
248  Status Echo2(ServerContext* context, const EchoRequest* request,
249  EchoResponse* response) {
250  return Echo(context, request, response);
251  }
252 
254  const SimpleRequest* /*request*/,
255  SimpleResponse* /*response*/) {
259  1);
260  EXPECT_EQ(1u,
261  context->client_metadata().count(kCheckClientInitialMetadataKey));
262  return Status::OK;
263  }
264 
265  // Unimplemented is left unimplemented to test the returned error.
266 
269  EchoResponse* response) {
270  // If 'server_try_cancel' is set in the metadata, the RPC is cancelled by
271  // the server by calling ServerContext::TryCancel() depending on the value:
272  // CANCEL_BEFORE_PROCESSING: The RPC is cancelled before the server reads
273  // any message from the client
274  // CANCEL_DURING_PROCESSING: The RPC is cancelled while the server is
275  // reading messages from the client
276  // CANCEL_AFTER_PROCESSING: The RPC is cancelled after the server reads
277  // all the messages from the client
278  int server_try_cancel = internal::GetIntValueFromMetadata(
279  kServerTryCancelRequest, context->client_metadata(), DO_NOT_CANCEL);
280 
281  EchoRequest request;
282  response->set_message("");
283 
284  if (server_try_cancel == CANCEL_BEFORE_PROCESSING) {
286  return Status::CANCELLED;
287  }
288 
289  std::thread* server_try_cancel_thd = nullptr;
290  if (server_try_cancel == CANCEL_DURING_PROCESSING) {
291  server_try_cancel_thd =
293  }
294 
295  int num_msgs_read = 0;
296  while (reader->Read(&request)) {
297  response->mutable_message()->append(request.message());
298  }
299  gpr_log(GPR_INFO, "Read: %d messages", num_msgs_read);
300 
301  if (server_try_cancel_thd != nullptr) {
302  server_try_cancel_thd->join();
303  delete server_try_cancel_thd;
304  return Status::CANCELLED;
305  }
306 
307  if (server_try_cancel == CANCEL_AFTER_PROCESSING) {
309  return Status::CANCELLED;
310  }
311 
312  return Status::OK;
313  }
314 
315  // Return 'kNumResponseStreamMsgs' messages.
316  // TODO(yangg) make it generic by adding a parameter into EchoRequest
319  // If server_try_cancel is set in the metadata, the RPC is cancelled by the
320  // server by calling ServerContext::TryCancel() depending on the value:
321  // CANCEL_BEFORE_PROCESSING: The RPC is cancelled before the server writes
322  // any messages to the client
323  // CANCEL_DURING_PROCESSING: The RPC is cancelled while the server is
324  // writing messages to the client
325  // CANCEL_AFTER_PROCESSING: The RPC is cancelled after the server writes
326  // all the messages to the client
327  int server_try_cancel = internal::GetIntValueFromMetadata(
328  kServerTryCancelRequest, context->client_metadata(), DO_NOT_CANCEL);
329 
330  int server_coalescing_api = internal::GetIntValueFromMetadata(
331  kServerUseCoalescingApi, context->client_metadata(), 0);
332 
333  int server_responses_to_send = internal::GetIntValueFromMetadata(
334  kServerResponseStreamsToSend, context->client_metadata(),
336 
337  if (server_try_cancel == CANCEL_BEFORE_PROCESSING) {
339  return Status::CANCELLED;
340  }
341 
342  EchoResponse response;
343  std::thread* server_try_cancel_thd = nullptr;
344  if (server_try_cancel == CANCEL_DURING_PROCESSING) {
345  server_try_cancel_thd =
347  }
348 
349  for (int i = 0; i < server_responses_to_send; i++) {
350  response.set_message(request->message() + std::to_string(i));
351  if (i == server_responses_to_send - 1 && server_coalescing_api != 0) {
352  writer->WriteLast(response, WriteOptions());
353  } else {
354  writer->Write(response);
355  }
356  }
357 
358  if (server_try_cancel_thd != nullptr) {
359  server_try_cancel_thd->join();
360  delete server_try_cancel_thd;
361  return Status::CANCELLED;
362  }
363 
364  if (server_try_cancel == CANCEL_AFTER_PROCESSING) {
366  return Status::CANCELLED;
367  }
368 
369  return Status::OK;
370  }
371 
374  // If server_try_cancel is set in the metadata, the RPC is cancelled by the
375  // server by calling ServerContext::TryCancel() depending on the value:
376  // CANCEL_BEFORE_PROCESSING: The RPC is cancelled before the server reads/
377  // writes any messages from/to the client
378  // CANCEL_DURING_PROCESSING: The RPC is cancelled while the server is
379  // reading/writing messages from/to the client
380  // CANCEL_AFTER_PROCESSING: The RPC is cancelled after the server
381  // reads/writes all messages from/to the client
382  int server_try_cancel = internal::GetIntValueFromMetadata(
383  kServerTryCancelRequest, context->client_metadata(), DO_NOT_CANCEL);
384 
385  int client_try_cancel = static_cast<bool>(internal::GetIntValueFromMetadata(
386  kClientTryCancelRequest, context->client_metadata(), 0));
387 
388  EchoRequest request;
389  EchoResponse response;
390 
391  if (server_try_cancel == CANCEL_BEFORE_PROCESSING) {
393  return Status::CANCELLED;
394  }
395 
396  std::thread* server_try_cancel_thd = nullptr;
397  if (server_try_cancel == CANCEL_DURING_PROCESSING) {
398  server_try_cancel_thd =
400  }
401 
402  // kServerFinishAfterNReads suggests after how many reads, the server should
403  // write the last message and send status (coalesced using WriteLast)
404  int server_write_last = internal::GetIntValueFromMetadata(
405  kServerFinishAfterNReads, context->client_metadata(), 0);
406 
407  int read_counts = 0;
408  while (stream->Read(&request)) {
409  read_counts++;
410  gpr_log(GPR_INFO, "recv msg %s", request.message().c_str());
411  response.set_message(request.message());
412  if (read_counts == server_write_last) {
413  stream->WriteLast(response, WriteOptions());
414  break;
415  } else {
416  stream->Write(response);
417  }
418  }
419 
420  if (client_try_cancel) {
421  EXPECT_TRUE(context->IsCancelled());
422  }
423 
424  if (server_try_cancel_thd != nullptr) {
425  server_try_cancel_thd->join();
426  delete server_try_cancel_thd;
427  return Status::CANCELLED;
428  }
429 
430  if (server_try_cancel == CANCEL_AFTER_PROCESSING) {
432  return Status::CANCELLED;
433  }
434 
435  return Status::OK;
436  }
437 
438  // Unimplemented is left unimplemented to test the returned error.
439  bool signal_client() {
440  std::unique_lock<std::mutex> lock(mu_);
441  return signal_client_;
442  }
446  std::unique_lock<std::mutex> lock(mu_);
448  }
449 
450  private:
454  std::unique_ptr<std::string> host_;
456 };
457 
458 class CallbackTestServiceImpl
459  : public grpc::testing::EchoTestService::CallbackService {
460  public:
462  explicit CallbackTestServiceImpl(const std::string& host)
463  : signal_client_(false), host_(new std::string(host)) {}
464 
466  const EchoRequest* request,
467  EchoResponse* response) override;
468 
469  ServerUnaryReactor* CheckClientInitialMetadata(CallbackServerContext* context,
470  const SimpleRequest*,
471  SimpleResponse*) override;
472 
473  ServerReadReactor<EchoRequest>* RequestStream(
474  CallbackServerContext* context, EchoResponse* response) override;
475 
476  ServerWriteReactor<EchoResponse>* ResponseStream(
477  CallbackServerContext* context, const EchoRequest* request) override;
478 
480  CallbackServerContext* context) override;
481 
482  // Unimplemented is left unimplemented to test the returned error.
483  bool signal_client() {
484  std::unique_lock<std::mutex> lock(mu_);
485  return signal_client_;
486  }
489 
490  private:
494  std::unique_ptr<std::string> host_;
495 };
496 
497 using TestServiceImpl =
499 
500 } // namespace testing
501 } // namespace grpc
502 
503 #endif // GRPC_TEST_CPP_END2END_TEST_SERVICE_IMPL_H
EXPECT_FALSE
#define EXPECT_FALSE(condition)
Definition: bloaty/third_party/googletest/googletest/include/gtest/gtest.h:1970
grpc::testing::TestMultipleServiceImpl::mu_
std::mutex mu_
Definition: test_service_impl.h:452
GPR_TIMESPAN
@ GPR_TIMESPAN
Definition: gpr_types.h:45
messages_pb2.SimpleRequest
SimpleRequest
Definition: messages_pb2.py:597
grpc::ClientContext::peer
std::string peer() const
Definition: client_context.cc:174
GPR_INFO
#define GPR_INFO
Definition: include/grpc/impl/codegen/log.h:56
testing
Definition: aws_request_signer_test.cc:25
grpc::testing::TestMultipleServiceImpl::BidiStream
Status BidiStream(ServerContext *context, ServerReaderWriter< EchoResponse, EchoRequest > *stream)
Definition: test_service_impl.h:372
grpc::ServerWriter
Definition: include/grpcpp/impl/codegen/completion_queue.h:60
grpc::testing::CallbackTestServiceImpl::mu_
std::mutex mu_
Definition: test_service_impl.h:492
grpc::ServerContext
Definition: grpcpp/impl/codegen/server_context.h:566
log.h
grpc::Status::CANCELLED
static const Status & CANCELLED
A CANCELLED pre-defined instance.
Definition: include/grpcpp/impl/codegen/status.h:115
metadata
Definition: cq_verifier.cc:48
grpc::testing::TestMultipleServiceImpl
Definition: test_service_impl.h:118
grpc
Definition: grpcpp/alarm.h:33
grpc::testing::TestServiceSignaller::rpc_started_
bool rpc_started_
Definition: test_service_impl.h:112
grpc::ServerReadReactor
ServerReadReactor is the interface for a client-streaming RPC.
Definition: impl/codegen/server_callback.h:184
grpc::testing::CallbackTestServiceImpl::host_
std::unique_ptr< std::string > host_
Definition: test_service_impl.h:494
grpc::testing::kClientTryCancelRequest
const char *const kClientTryCancelRequest
Definition: test_service_impl.h:45
false
#define false
Definition: setup_once.h:323
mutex
static uv_mutex_t mutex
Definition: threadpool.c:34
grpc::testing::TestServiceSignaller::mu_
std::mutex mu_
Definition: test_service_impl.h:110
grpc::testing::TestMultipleServiceImpl::signaller_
TestServiceSignaller signaller_
Definition: test_service_impl.h:453
grpc::testing::CallbackTestServiceImpl::ClientWaitUntilRpcStarted
void ClientWaitUntilRpcStarted()
Definition: test_service_impl.h:487
grpc::testing::CallbackTestServiceImpl::signal_client
bool signal_client()
Definition: test_service_impl.h:483
grpc::testing::TestServiceSignaller::server_should_continue_
bool server_should_continue_
Definition: test_service_impl.h:114
benchmark.request
request
Definition: benchmark.py:77
grpc::testing::TestServiceSignaller::ServerWaitToContinue
void ServerWaitToContinue()
Definition: test_service_impl.h:94
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
error
grpc_error_handle error
Definition: retry_filter.cc:499
grpc::testing::CANCEL_AFTER_PROCESSING
@ CANCEL_AFTER_PROCESSING
Definition: test_service_impl.h:56
grpc::testing::TestMultipleServiceImpl::signal_client_
bool signal_client_
Definition: test_service_impl.h:451
u
OPENSSL_EXPORT pem_password_cb void * u
Definition: pem.h:351
grpc::testing::CallbackTestServiceImpl::CallbackTestServiceImpl
CallbackTestServiceImpl()
Definition: test_service_impl.h:461
grpc::testing::internal::MetadataMatchCount
int MetadataMatchCount(const std::multimap< grpc::string_ref, grpc::string_ref > &metadata, const std::string &key, const std::string &value)
Definition: test_service_impl.cc:75
grpc::ServerReaderWriter
Definition: grpcpp/impl/codegen/sync_stream.h:786
grpc::testing::DO_NOT_CANCEL
@ DO_NOT_CANCEL
Definition: test_service_impl.h:53
alarm.h
env.new
def new
Definition: env.py:51
grpc::ServerBidiReactor
ServerBidiReactor is the interface for a bidirectional streaming RPC.
Definition: impl/codegen/server_callback.h:188
grpc::testing::TestServiceImpl
TestMultipleServiceImpl< grpc::testing::EchoTestService::Service > TestServiceImpl
Definition: test_service_impl.h:498
grpc::testing::internal::CheckServerAuthContext
void CheckServerAuthContext(const ServerContextBase *context, const std::string &expected_transport_security_type, const std::string &expected_client_identity)
Definition: test_service_impl.cc:53
mu_
Mutex mu_
Definition: oob_backend_metric.cc:115
grpc::WriteOptions
Per-message write options.
Definition: call_op_set.h:81
grpc::testing::kCheckClientInitialMetadataKey
const char *const kCheckClientInitialMetadataKey
Definition: test_service_impl.h:49
grpc::testing::TestMultipleServiceImpl::SignalServerToContinue
void SignalServerToContinue()
Definition: test_service_impl.h:444
grpc::testing::TestMultipleServiceImpl::Echo2
Status Echo2(ServerContext *context, const EchoRequest *request, EchoResponse *response)
Definition: test_service_impl.h:248
grpc::testing::internal::MaybeEchoDeadline
void MaybeEchoDeadline(ServerContextBase *context, const EchoRequest *request, EchoResponse *response)
Definition: test_service_impl.cc:42
grpc::testing::TestMultipleServiceImpl::TestMultipleServiceImpl
TestMultipleServiceImpl()
Definition: test_service_impl.h:120
grpc::testing::kServerDefaultResponseStreamsToSend
const int kServerDefaultResponseStreamsToSend
Definition: test_service_impl.h:42
grpc::testing::TestMultipleServiceImpl::ClientWaitUntilRpcStarted
void ClientWaitUntilRpcStarted()
Definition: test_service_impl.h:443
absl::move
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
Definition: abseil-cpp/absl/utility/utility.h:221
GPR_ASSERT
#define GPR_ASSERT(x)
Definition: include/grpc/impl/codegen/log.h:94
grpc::ServerContextBase
Base class of ServerContext.
Definition: grpcpp/impl/codegen/server_context.h:126
grpc.StatusCode
Definition: src/python/grpcio/grpc/__init__.py:232
gpr_log
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
grpc::testing::TestMultipleServiceImpl::ResponseStream
Status ResponseStream(ServerContext *context, const EchoRequest *request, ServerWriter< EchoResponse > *writer)
Definition: test_service_impl.h:317
grpc::testing::kServerResponseStreamsToSend
const char *const kServerResponseStreamsToSend
Definition: test_service_impl.h:43
gpr_sleep_until
GPRAPI void gpr_sleep_until(gpr_timespec until)
grpc.h
grpc::testing::TestMultipleServiceImpl::CheckClientInitialMetadata
Status CheckClientInitialMetadata(ServerContext *context, const SimpleRequest *, SimpleResponse *)
Definition: test_service_impl.h:253
uint64_t
unsigned __int64 uint64_t
Definition: stdint-msvc2008.h:90
grpc::testing::TestMultipleServiceImpl::signal_client
bool signal_client()
Definition: test_service_impl.h:439
grpc::testing::ServerTryCancelRequestPhase
ServerTryCancelRequestPhase
Definition: test_service_impl.h:52
grpc::testing::CallbackTestServiceImpl::signal_client_
bool signal_client_
Definition: test_service_impl.h:491
GPR_CLOCK_MONOTONIC
@ GPR_CLOCK_MONOTONIC
Definition: gpr_types.h:36
grpc::Status::OK
static const Status & OK
An OK pre-defined instance.
Definition: include/grpcpp/impl/codegen/status.h:113
grpc::testing::internal::ServerTryCancel
void ServerTryCancel(ServerContext *context)
Definition: test_service_impl.cc:108
grpc::testing::TestMultipleServiceImpl::RequestStream
Status RequestStream(ServerContext *context, ServerReader< EchoRequest > *reader, EchoResponse *response)
Definition: test_service_impl.h:267
GPR_ERROR
#define GPR_ERROR
Definition: include/grpc/impl/codegen/log.h:57
grpc::testing::TestMultipleServiceImpl::Echo
Status Echo(ServerContext *context, const EchoRequest *request, EchoResponse *response)
Definition: test_service_impl.h:124
gpr_now
GPRAPI gpr_timespec gpr_now(gpr_clock_type clock)
grpc::CallbackServerContext
Definition: grpcpp/impl/codegen/server_context.h:606
grpc::testing::TestServiceSignaller::SignalClientThatRpcStarted
void SignalClientThatRpcStarted()
Definition: test_service_impl.h:98
writer
void writer(void *n)
Definition: libuv/docs/code/locks/main.c:22
grpc::testing::TestServiceSignaller
Definition: test_service_impl.h:88
value
const char * value
Definition: hpack_parser_table.cc:165
grpc::testing::kServerTryCancelRequest
const char *const kServerTryCancelRequest
Definition: test_service_impl.h:44
credentials.h
key
const char * key
Definition: hpack_parser_table.cc:164
grpc::testing::kCheckClientInitialMetadataVal
const char *const kCheckClientInitialMetadataVal
Definition: test_service_impl.h:50
gpr_time_add
GPRAPI gpr_timespec gpr_time_add(gpr_timespec a, gpr_timespec b)
Definition: src/core/lib/gpr/time.cc:135
grpc::testing::TestMultipleServiceImpl::rpcs_waiting_for_client_cancel_
uint64_t rpcs_waiting_for_client_cancel_
Definition: test_service_impl.h:455
grpc::testing::TestServiceSignaller::SignalServerToContinue
void SignalServerToContinue()
Definition: test_service_impl.h:103
grpc::testing::ToString
std::string ToString(const grpc::string_ref &r)
Definition: string_ref_helper.cc:24
gpr_time_from_micros
GPRAPI gpr_timespec gpr_time_from_micros(int64_t us, gpr_clock_type clock_type)
Definition: src/core/lib/gpr/time.cc:115
server_context.h
asyncio_get_stats.response
response
Definition: asyncio_get_stats.py:28
std
Definition: grpcpp/impl/codegen/async_unary_call.h:407
grpc::testing::CallbackTestServiceImpl::SignalServerToContinue
void SignalServerToContinue()
Definition: test_service_impl.h:488
grpc::testing::internal::GetIntValueFromMetadata
int GetIntValueFromMetadata(const char *key, const std::multimap< grpc::string_ref, grpc::string_ref > &metadata, int default_value)
Definition: test_service_impl.cc:101
grpc::protobuf::util::Status
GRPC_CUSTOM_UTIL_STATUS Status
Definition: include/grpcpp/impl/codegen/config_protobuf.h:93
grpc::ServerReader
Definition: include/grpcpp/impl/codegen/completion_queue.h:58
grpc::testing::kServerUseCoalescingApi
const char *const kServerUseCoalescingApi
Definition: test_service_impl.h:48
grpc::Status
Definition: include/grpcpp/impl/codegen/status.h:35
grpc::testing::CallbackTestServiceImpl::CallbackTestServiceImpl
CallbackTestServiceImpl(const std::string &host)
Definition: test_service_impl.h:462
grpc::testing::internal::GetIntValueFromMetadataHelper
int GetIntValueFromMetadataHelper(const char *key, const std::multimap< grpc::string_ref, grpc::string_ref > &metadata, int default_value)
Definition: test_service_impl.cc:88
grpc::testing::EXPECT_EQ
EXPECT_EQ(options.token_exchange_service_uri, "https://foo/exchange")
grpc::testing::CANCEL_DURING_PROCESSING
@ CANCEL_DURING_PROCESSING
Definition: test_service_impl.h:55
grpc::ServerUnaryReactor
Definition: impl/codegen/server_callback.h:699
grpc::testing::CallbackTestServiceImpl::signaller_
TestServiceSignaller signaller_
Definition: test_service_impl.h:493
grpc::testing::kServerFinishAfterNReads
const char *const kServerFinishAfterNReads
Definition: test_service_impl.h:47
grpc::testing::TestMultipleServiceImpl::host_
std::unique_ptr< std::string > host_
Definition: test_service_impl.h:454
internal
Definition: benchmark/test/output_test_helper.cc:20
context
grpc::ClientContext context
Definition: istio_echo_server_lib.cc:61
grpc::testing::TestServiceSignaller::cv_server_continue_
std::condition_variable cv_server_continue_
Definition: test_service_impl.h:113
grpc::testing::TestMultipleServiceImpl::Echo1
Status Echo1(ServerContext *context, const EchoRequest *request, EchoResponse *response)
Definition: test_service_impl.h:243
grpc::testing::EXPECT_TRUE
EXPECT_TRUE(grpc::experimental::StsCredentialsOptionsFromJson(minimum_valid_json, &options) .ok())
grpc::testing::kDebugInfoTrailerKey
const char *const kDebugInfoTrailerKey
Definition: test_service_impl.h:46
grpc::testing::TestServiceSignaller::ClientWaitUntilRpcStarted
void ClientWaitUntilRpcStarted()
Definition: test_service_impl.h:90
grpc::testing::TestMultipleServiceImpl::TestMultipleServiceImpl
TestMultipleServiceImpl(const std::string &host)
Definition: test_service_impl.h:121
messages_pb2.SimpleResponse
SimpleResponse
Definition: messages_pb2.py:604
GPR_CLOCK_REALTIME
@ GPR_CLOCK_REALTIME
Definition: gpr_types.h:39
string_ref_helper.h
to_string
static bool to_string(zval *from)
Definition: protobuf/php/ext/google/protobuf/convert.c:333
grpc::ServerWriteReactor
ServerWriteReactor is the interface for a server-streaming RPC.
Definition: impl/codegen/server_callback.h:186
grpc::testing::CANCEL_BEFORE_PROCESSING
@ CANCEL_BEFORE_PROCESSING
Definition: test_service_impl.h:54
thread
static uv_thread_t thread
Definition: test-async-null-cb.c:29
grpc::testing::TestServiceSignaller::cv_rpc_started_
std::condition_variable cv_rpc_started_
Definition: test_service_impl.h:111
reader
void reader(void *n)
Definition: libuv/docs/code/locks/main.c:8
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
grpc::testing::TestMultipleServiceImpl::RpcsWaitingForClientCancel
uint64_t RpcsWaitingForClientCancel()
Definition: test_service_impl.h:445
stream
voidpf stream
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:136


grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:01:32