Skip to content

Commit

Permalink
Let grpc_init/shutdown cover credentials create/release
Browse files Browse the repository at this point in the history
  • Loading branch information
yang-g committed May 15, 2020
1 parent 10b5065 commit 2b78747
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions test/core/surface/sequential_connectivity_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ static void run_test(const test_fixture* fixture, bool share_subchannel) {
gpr_log(GPR_INFO, "TEST: %s sharing subchannel: %d", fixture->name,
share_subchannel);

grpc_init();

std::string addr =
grpc_core::JoinHostPort("localhost", grpc_pick_unused_port_or_die());

Expand Down Expand Up @@ -147,8 +145,6 @@ static void run_test(const test_fixture* fixture, bool share_subchannel) {
grpc_server_destroy(server);
grpc_completion_queue_destroy(server_cq);
grpc_completion_queue_destroy(cq);

grpc_shutdown();
}

static void insecure_test_add_port(grpc_server* server, const char* addr) {
Expand Down Expand Up @@ -176,13 +172,13 @@ static void secure_test_add_port(grpc_server* server, const char* addr) {

int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(argc, argv);
grpc_init();

const test_fixture insecure_test = {
"insecure",
insecure_test_add_port,
nullptr,
};

run_test(&insecure_test, /*share_subchannel=*/true);
run_test(&insecure_test, /*share_subchannel=*/false);

Expand All @@ -202,4 +198,6 @@ int main(int argc, char** argv) {
run_test(&secure_test, /*share_subchannel=*/true);
run_test(&secure_test, /*share_subchannel=*/false);
grpc_channel_credentials_release(ssl_creds);

grpc_shutdown();
}

0 comments on commit 2b78747

Please sign in to comment.