Skip to content

Commit 2b78747

Browse files
committed
Let grpc_init/shutdown cover credentials create/release
1 parent 10b5065 commit 2b78747

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

test/core/surface/sequential_connectivity_test.cc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,6 @@ static void run_test(const test_fixture* fixture, bool share_subchannel) {
8686
gpr_log(GPR_INFO, "TEST: %s sharing subchannel: %d", fixture->name,
8787
share_subchannel);
8888

89-
grpc_init();
90-
9189
std::string addr =
9290
grpc_core::JoinHostPort("localhost", grpc_pick_unused_port_or_die());
9391

@@ -147,8 +145,6 @@ static void run_test(const test_fixture* fixture, bool share_subchannel) {
147145
grpc_server_destroy(server);
148146
grpc_completion_queue_destroy(server_cq);
149147
grpc_completion_queue_destroy(cq);
150-
151-
grpc_shutdown();
152148
}
153149

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

177173
int main(int argc, char** argv) {
178174
grpc::testing::TestEnvironment env(argc, argv);
175+
grpc_init();
179176

180177
const test_fixture insecure_test = {
181178
"insecure",
182179
insecure_test_add_port,
183180
nullptr,
184181
};
185-
186182
run_test(&insecure_test, /*share_subchannel=*/true);
187183
run_test(&insecure_test, /*share_subchannel=*/false);
188184

@@ -202,4 +198,6 @@ int main(int argc, char** argv) {
202198
run_test(&secure_test, /*share_subchannel=*/true);
203199
run_test(&secure_test, /*share_subchannel=*/false);
204200
grpc_channel_credentials_release(ssl_creds);
201+
202+
grpc_shutdown();
205203
}

0 commit comments

Comments
 (0)