Go to the documentation of this file.
24 #include <gmock/gmock.h>
26 #include "absl/strings/str_format.h"
48 void TryConnectAndDestroy(
const char* fake_metadata_server_address) {
51 args.SetInt(
"grpc.testing.google_c2p_resolver_pretend_running_on_gcp", 1);
52 args.SetString(
"grpc.testing.google_c2p_resolver_metadata_server_override",
53 fake_metadata_server_address);
66 TEST(DestroyGoogleC2pChannelWithActiveConnectStressTest,
67 LoopTryConnectAndDestroyWithHangingMetadataServer) {
71 kWaitForClientToSendFirstBytes,
73 std::vector<std::unique_ptr<std::thread>>
threads;
78 new std::thread(TryConnectAndDestroy, fake_metadata_server.address()));
87 TEST(DestroyGoogleC2pChannelWithActiveConnectStressTest,
88 LoopTryConnectAndDestroyWithFastFailingMetadataServer) {
92 std::vector<std::unique_ptr<std::thread>>
threads;
97 new std::thread(TryConnectAndDestroy, address.c_str()));
106 int main(
int argc,
char** argv) {
108 gpr_setenv(
"GRPC_EXPERIMENTAL_GOOGLE_C2P_RESOLVER",
"true");
ABSL_MUST_USE_RESULT std::string StrFormat(const FormatSpec< Args... > &format, const Args &... args)
static uv_thread_t * threads
wrapped_grpc_channel * channel
#define TEST(name, init_size,...)
gpr_timespec grpc_timeout_milliseconds_to_deadline(int64_t time_ms)
int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_
int grpc_pick_unused_port_or_die(void)
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
std::shared_ptr< Channel > CreateCustomChannel(const grpc::string &target, const std::shared_ptr< ChannelCredentials > &creds, const ChannelArguments &args)
#define ASSERT_FALSE(condition)
static ProcessReadResult CloseSocketUponCloseFromPeer(int bytes_received_size, int read_error, int s)
int main(int argc, char **argv)
std::shared_ptr< ChannelCredentials > InsecureChannelCredentials()
Credentials for an unencrypted, unauthenticated channel.
GRPCAPI void grpc_init(void)
GRPCAPI void grpc_shutdown(void)
static uv_thread_t thread
void gpr_setenv(const char *name, const char *value)
grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:39