aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/iomgr/fd_conservation_posix_test.cc
diff options
context:
space:
mode:
authorGravatar Yash Tibrewal <yashkt@google.com>2017-12-06 09:47:54 -0800
committerGravatar GitHub <noreply@github.com>2017-12-06 09:47:54 -0800
commit8cf1470a51ea276ca84825e7495d4ee24743540d (patch)
tree72385cc865094115bc08cb813201d48cb09840bb /test/core/iomgr/fd_conservation_posix_test.cc
parent1d4e99508409be052bd129ba507bae1fbe7eb7fa (diff)
Revert "Revert "All instances of exec_ctx being passed around in src/core removed""
Diffstat (limited to 'test/core/iomgr/fd_conservation_posix_test.cc')
-rw-r--r--test/core/iomgr/fd_conservation_posix_test.cc37
1 files changed, 19 insertions, 18 deletions
diff --git a/test/core/iomgr/fd_conservation_posix_test.cc b/test/core/iomgr/fd_conservation_posix_test.cc
index f46430c611..aaa14010f8 100644
--- a/test/core/iomgr/fd_conservation_posix_test.cc
+++ b/test/core/iomgr/fd_conservation_posix_test.cc
@@ -31,26 +31,27 @@ int main(int argc, char** argv) {
grpc_test_init(argc, argv);
grpc_init();
- grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
-
- /* set max # of file descriptors to a low value, and
- verify we can create and destroy many more than this number
- of descriptors */
- rlim.rlim_cur = rlim.rlim_max = 10;
- GPR_ASSERT(0 == setrlimit(RLIMIT_NOFILE, &rlim));
- grpc_resource_quota* resource_quota =
- grpc_resource_quota_create("fd_conservation_posix_test");
-
- for (i = 0; i < 100; i++) {
- p = grpc_iomgr_create_endpoint_pair("test", nullptr);
- grpc_endpoint_destroy(&exec_ctx, p.client);
- grpc_endpoint_destroy(&exec_ctx, p.server);
- grpc_exec_ctx_flush(&exec_ctx);
+ {
+ grpc_core::ExecCtx exec_ctx;
+
+ /* set max # of file descriptors to a low value, and
+ verify we can create and destroy many more than this number
+ of descriptors */
+ rlim.rlim_cur = rlim.rlim_max = 10;
+ GPR_ASSERT(0 == setrlimit(RLIMIT_NOFILE, &rlim));
+ grpc_resource_quota* resource_quota =
+ grpc_resource_quota_create("fd_conservation_posix_test");
+
+ for (i = 0; i < 100; i++) {
+ p = grpc_iomgr_create_endpoint_pair("test", NULL);
+ grpc_endpoint_destroy(p.client);
+ grpc_endpoint_destroy(p.server);
+ grpc_core::ExecCtx::Get()->Flush();
+ }
+
+ grpc_resource_quota_unref(resource_quota);
}
- grpc_resource_quota_unref(resource_quota);
-
- grpc_exec_ctx_finish(&exec_ctx);
grpc_shutdown();
return 0;
}