diff options
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); |