From a65f9f5820573f10f27052fb523cf9cac1068a11 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Thu, 12 May 2016 10:14:35 -0700 Subject: Fix test usage of pollset --- test/core/iomgr/workqueue_test.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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); -- cgit v1.2.3