aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/iomgr/tcp_posix_test.cc
diff options
context:
space:
mode:
authorGravatar Yash Tibrewal <yashkt@google.com>2017-11-28 13:23:36 -0800
committerGravatar Yash Tibrewal <yashkt@google.com>2017-11-28 13:23:36 -0800
commit81fc8c9c336fab7a71b448f748a32d680301277c (patch)
tree5cd64fd191db0f87d59ef53768c1b6760b4f1654 /test/core/iomgr/tcp_posix_test.cc
parent3285f4c7329bf4305133be74f88dd4b10d5e2052 (diff)
Fix tests to call grpc_init and grpc_shutdown before using exec_ctx
Diffstat (limited to 'test/core/iomgr/tcp_posix_test.cc')
-rw-r--r--test/core/iomgr/tcp_posix_test.cc20
1 files changed, 11 insertions, 9 deletions
diff --git a/test/core/iomgr/tcp_posix_test.cc b/test/core/iomgr/tcp_posix_test.cc
index 614ceaa02d..b42fb588eb 100644
--- a/test/core/iomgr/tcp_posix_test.cc
+++ b/test/core/iomgr/tcp_posix_test.cc
@@ -538,18 +538,20 @@ static void destroy_pollset(void* p, grpc_error* error) {
int main(int argc, char** argv) {
grpc_closure destroyed;
- grpc_core::ExecCtx _local_exec_ctx;
grpc_test_init(argc, argv);
grpc_init();
- g_pollset = (grpc_pollset*)gpr_zalloc(grpc_pollset_size());
- grpc_pollset_init(g_pollset, &g_mu);
- grpc_endpoint_tests(configs[0], g_pollset, g_mu);
- run_tests();
- GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, g_pollset,
- grpc_schedule_on_exec_ctx);
- grpc_pollset_shutdown(g_pollset, &destroyed);
+ {
+ grpc_core::ExecCtx _local_exec_ctx;
+ g_pollset = (grpc_pollset*)gpr_zalloc(grpc_pollset_size());
+ grpc_pollset_init(g_pollset, &g_mu);
+ grpc_endpoint_tests(configs[0], g_pollset, g_mu);
+ run_tests();
+ GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, g_pollset,
+ grpc_schedule_on_exec_ctx);
+ grpc_pollset_shutdown(g_pollset, &destroyed);
- grpc_core::ExecCtx::Get()->Flush();
+ grpc_core::ExecCtx::Get()->Flush();
+ }
grpc_shutdown();
gpr_free(g_pollset);