diff options
author | Jan Tattermusch <jtattermusch@users.noreply.github.com> | 2016-05-13 11:37:12 -0700 |
---|---|---|
committer | Jan Tattermusch <jtattermusch@users.noreply.github.com> | 2016-05-13 11:37:12 -0700 |
commit | effd74c3cc307c67059e30fa47359f9ca7d6d672 (patch) | |
tree | 16017791bf23425e2d4634d09073e4e58fba7271 /test/core/iomgr | |
parent | ebf66403aabf03d519c9f7307149720faf6e1d47 (diff) | |
parent | 5f902c1267a0ab2748f1ca0ebb837a6a5190cbf5 (diff) |
Merge pull request #5456 from ctiller/cleaner-posix3
Splitting out a pure poll() based event engine
Diffstat (limited to 'test/core/iomgr')
-rw-r--r-- | test/core/iomgr/udp_server_test.c | 12 | ||||
-rw-r--r-- | test/core/iomgr/workqueue_test.c | 13 |
2 files changed, 15 insertions, 10 deletions
diff --git a/test/core/iomgr/udp_server_test.c b/test/core/iomgr/udp_server_test.c index a29a68eb33..1e7e4fad63 100644 --- a/test/core/iomgr/udp_server_test.c +++ b/test/core/iomgr/udp_server_test.c @@ -32,20 +32,22 @@ */ #include "src/core/lib/iomgr/udp_server.h" + +#include <netinet/in.h> +#include <string.h> +#include <sys/socket.h> +#include <unistd.h> + #include <grpc/grpc.h> #include <grpc/support/alloc.h> #include <grpc/support/log.h> #include <grpc/support/sync.h> #include <grpc/support/time.h> + #include "src/core/lib/iomgr/ev_posix.h" #include "src/core/lib/iomgr/iomgr.h" #include "test/core/util/test_config.h" -#include <netinet/in.h> -#include <string.h> -#include <sys/socket.h> -#include <unistd.h> - #ifdef GRPC_NEED_UDP #define LOG_TEST(x) gpr_log(GPR_INFO, "%s", #x) diff --git a/test/core/iomgr/workqueue_test.c b/test/core/iomgr/workqueue_test.c index 874e696fc2..953cc35ee6 100644 --- a/test/core/iomgr/workqueue_test.c +++ b/test/core/iomgr/workqueue_test.c @@ -73,8 +73,10 @@ static void test_add_closure(void) { gpr_mu_lock(g_mu); GPR_ASSERT(!done); - grpc_pollset_work(&exec_ctx, g_pollset, &worker, gpr_now(deadline.clock_type), - deadline); + while (!done) { + grpc_pollset_work(&exec_ctx, g_pollset, &worker, + gpr_now(deadline.clock_type), deadline); + } gpr_mu_unlock(g_mu); grpc_exec_ctx_finish(&exec_ctx); GPR_ASSERT(done); @@ -97,9 +99,10 @@ static void test_flush(void) { grpc_workqueue_add_to_pollset(&exec_ctx, wq, g_pollset); gpr_mu_lock(g_mu); - GPR_ASSERT(!done); - grpc_pollset_work(&exec_ctx, g_pollset, &worker, gpr_now(deadline.clock_type), - deadline); + while (!done) { + grpc_pollset_work(&exec_ctx, g_pollset, &worker, + gpr_now(deadline.clock_type), deadline); + } gpr_mu_unlock(g_mu); grpc_exec_ctx_finish(&exec_ctx); GPR_ASSERT(done); |