aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-05-12 10:14:35 -0700
committerGravatar Craig Tiller <ctiller@google.com>2016-05-12 10:14:35 -0700
commita65f9f5820573f10f27052fb523cf9cac1068a11 (patch)
tree6e75bab01edaea7558b10d8bdaeae73b42aff983 /test
parent4c2218e22930a4f17eaec4677470586e2d91e228 (diff)
Fix test usage of pollset
Diffstat (limited to 'test')
-rw-r--r--test/core/iomgr/workqueue_test.c13
1 files 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);