clang-format

pull/13336/head
Mark D. Roth 7 years ago
parent b9f34acfe5
commit aaad0c2e5a
  1. 4
      src/core/ext/transport/chttp2/client/chttp2_connector.cc
  2. 22
      test/core/transport/chttp2/settings_timeout_test.cc
  3. 12
      test/cpp/microbenchmarks/fullstack_fixtures.h

@ -117,8 +117,8 @@ static void on_handshake_done(grpc_exec_ctx* exec_ctx, void* arg,
} else { } else {
grpc_endpoint_delete_from_pollset_set(exec_ctx, args->endpoint, grpc_endpoint_delete_from_pollset_set(exec_ctx, args->endpoint,
c->args.interested_parties); c->args.interested_parties);
c->result->transport = grpc_create_chttp2_transport( c->result->transport = grpc_create_chttp2_transport(exec_ctx, args->args,
exec_ctx, args->args, args->endpoint, true); args->endpoint, true);
GPR_ASSERT(c->result->transport); GPR_ASSERT(c->result->transport);
// TODO(roth): We ideally want to wait until we receive HTTP/2 // TODO(roth): We ideally want to wait until we receive HTTP/2
// settings from the server before we consider the connection // settings from the server before we consider the connection

@ -67,7 +67,8 @@ class ServerThread {
grpc_server_shutdown_and_notify(server_, shutdown_cq, nullptr); grpc_server_shutdown_and_notify(server_, shutdown_cq, nullptr);
GPR_ASSERT(grpc_completion_queue_pluck(shutdown_cq, nullptr, GPR_ASSERT(grpc_completion_queue_pluck(shutdown_cq, nullptr,
grpc_timeout_seconds_to_deadline(1), grpc_timeout_seconds_to_deadline(1),
nullptr).type == GRPC_OP_COMPLETE); nullptr)
.type == GRPC_OP_COMPLETE);
grpc_completion_queue_destroy(shutdown_cq); grpc_completion_queue_destroy(shutdown_cq);
grpc_server_destroy(server_); grpc_server_destroy(server_);
grpc_completion_queue_destroy(cq_); grpc_completion_queue_destroy(cq_);
@ -98,8 +99,8 @@ class Client {
void Connect() { void Connect() {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_resolved_addresses* server_addresses = nullptr; grpc_resolved_addresses* server_addresses = nullptr;
grpc_error* error = grpc_blocking_resolve_address(server_address_, grpc_error* error =
"80", &server_addresses); grpc_blocking_resolve_address(server_address_, "80", &server_addresses);
ASSERT_EQ(GRPC_ERROR_NONE, error) << grpc_error_string(error); ASSERT_EQ(GRPC_ERROR_NONE, error) << grpc_error_string(error);
ASSERT_GE(server_addresses->naddrs, 1UL); ASSERT_GE(server_addresses->naddrs, 1UL);
pollset_ = (grpc_pollset*)gpr_zalloc(grpc_pollset_size()); pollset_ = (grpc_pollset*)gpr_zalloc(grpc_pollset_size());
@ -107,12 +108,12 @@ class Client {
grpc_pollset_set* pollset_set = grpc_pollset_set_create(); grpc_pollset_set* pollset_set = grpc_pollset_set_create();
grpc_pollset_set_add_pollset(&exec_ctx, pollset_set, pollset_); grpc_pollset_set_add_pollset(&exec_ctx, pollset_set, pollset_);
EventState state; EventState state;
grpc_tcp_client_connect(&exec_ctx, state.closure(), &endpoint_, grpc_tcp_client_connect(&exec_ctx, state.closure(), &endpoint_, pollset_set,
pollset_set, nullptr /* channel_args */, nullptr /* channel_args */, server_addresses->addrs,
server_addresses->addrs, 1000); 1000);
ASSERT_TRUE(PollUntilDone(&exec_ctx, &state, ASSERT_TRUE(PollUntilDone(
grpc_timespec_to_millis_round_up( &exec_ctx, &state,
gpr_inf_future(GPR_CLOCK_MONOTONIC)))); grpc_timespec_to_millis_round_up(gpr_inf_future(GPR_CLOCK_MONOTONIC))));
ASSERT_EQ(GRPC_ERROR_NONE, state.error()); ASSERT_EQ(GRPC_ERROR_NONE, state.error());
grpc_pollset_set_destroy(&exec_ctx, pollset_set); grpc_pollset_set_destroy(&exec_ctx, pollset_set);
grpc_endpoint_add_to_pollset(&exec_ctx, endpoint_, pollset_); grpc_endpoint_add_to_pollset(&exec_ctx, endpoint_, pollset_);
@ -195,8 +196,7 @@ class Client {
while (true) { while (true) {
grpc_pollset_worker* worker = nullptr; grpc_pollset_worker* worker = nullptr;
gpr_mu_lock(mu_); gpr_mu_lock(mu_);
GRPC_LOG_IF_ERROR( GRPC_LOG_IF_ERROR("grpc_pollset_work",
"grpc_pollset_work",
grpc_pollset_work(exec_ctx, pollset_, &worker, grpc_pollset_work(exec_ctx, pollset_, &worker,
grpc_exec_ctx_now(exec_ctx) + 1000)); grpc_exec_ctx_now(exec_ctx) + 1000));
gpr_mu_unlock(mu_); gpr_mu_unlock(mu_);

@ -186,8 +186,8 @@ class EndpointPairFixture : public BaseFixture {
grpc_server_setup_transport(&exec_ctx, server_->c_server(), grpc_server_setup_transport(&exec_ctx, server_->c_server(),
server_transport_, nullptr, server_args); server_transport_, nullptr, server_args);
grpc_chttp2_transport_start_reading(&exec_ctx, server_transport_, grpc_chttp2_transport_start_reading(&exec_ctx, server_transport_, nullptr,
nullptr, nullptr); nullptr);
} }
/* create channel */ /* create channel */
@ -197,14 +197,14 @@ class EndpointPairFixture : public BaseFixture {
fixture_configuration.ApplyCommonChannelArguments(&args); fixture_configuration.ApplyCommonChannelArguments(&args);
grpc_channel_args c_args = args.c_channel_args(); grpc_channel_args c_args = args.c_channel_args();
client_transport_ = grpc_create_chttp2_transport( client_transport_ = grpc_create_chttp2_transport(&exec_ctx, &c_args,
&exec_ctx, &c_args, endpoints.client, true); endpoints.client, true);
GPR_ASSERT(client_transport_); GPR_ASSERT(client_transport_);
grpc_channel* channel = grpc_channel* channel =
grpc_channel_create(&exec_ctx, "target", &c_args, grpc_channel_create(&exec_ctx, "target", &c_args,
GRPC_CLIENT_DIRECT_CHANNEL, client_transport_); GRPC_CLIENT_DIRECT_CHANNEL, client_transport_);
grpc_chttp2_transport_start_reading(&exec_ctx, client_transport_, grpc_chttp2_transport_start_reading(&exec_ctx, client_transport_, nullptr,
nullptr, nullptr); nullptr);
channel_ = CreateChannelInternal("", channel); channel_ = CreateChannelInternal("", channel);
} }

Loading…
Cancel
Save