diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/core/bad_client/bad_client.cc | 6 | ||||
-rw-r--r-- | test/core/end2end/bad_server_response_test.cc | 2 | ||||
-rw-r--r-- | test/core/iomgr/resource_quota_test.cc | 60 | ||||
-rw-r--r-- | test/core/iomgr/tcp_posix_test.cc | 1 | ||||
-rw-r--r-- | test/core/iomgr/tcp_server_posix_test.cc | 1 | ||||
-rw-r--r-- | test/core/iomgr/timer_list_test.cc | 12 | ||||
-rw-r--r-- | test/core/iomgr/udp_server_test.cc | 2 | ||||
-rw-r--r-- | test/core/security/jwt_verifier_test.cc | 14 | ||||
-rw-r--r-- | test/core/security/secure_endpoint_test.cc | 1 | ||||
-rw-r--r-- | test/core/transport/connectivity_state_test.cc | 3 | ||||
-rw-r--r-- | test/core/util/port_server_client.cc | 1 | ||||
-rw-r--r-- | test/cpp/client/client_channel_stress_test.cc | 11 |
12 files changed, 60 insertions, 54 deletions
diff --git a/test/core/bad_client/bad_client.cc b/test/core/bad_client/bad_client.cc index 313c43f9b3..267933ff62 100644 --- a/test/core/bad_client/bad_client.cc +++ b/test/core/bad_client/bad_client.cc @@ -135,6 +135,7 @@ void grpc_run_bad_client_test( /* Write data */ grpc_endpoint_write(sfd.client, &outgoing, &done_write_closure); + grpc_core::ExecCtx::Get()->Flush(); /* Await completion, unless the request is large and write may not finish * before the peer shuts down. */ @@ -147,7 +148,7 @@ void grpc_run_bad_client_test( grpc_endpoint_shutdown( sfd.client, GRPC_ERROR_CREATE_FROM_STATIC_STRING("Forced Disconnect")); grpc_endpoint_destroy(sfd.client); - + grpc_core::ExecCtx::Get()->Flush(); sfd.client = nullptr; } @@ -167,7 +168,7 @@ void grpc_run_bad_client_test( GRPC_CLOSURE_INIT(&read_done_closure, read_done, &read_done_event, grpc_schedule_on_exec_ctx); grpc_endpoint_read(sfd.client, &incoming, &read_done_closure); - + grpc_core::ExecCtx::Get()->Flush(); do { GPR_ASSERT(gpr_time_cmp(deadline, gpr_now(deadline.clock_type)) > 0); GPR_ASSERT( @@ -186,6 +187,7 @@ void grpc_run_bad_client_test( grpc_endpoint_shutdown( sfd.client, GRPC_ERROR_CREATE_FROM_STATIC_STRING("Test Shutdown")); grpc_endpoint_destroy(sfd.client); + grpc_core::ExecCtx::Get()->Flush(); } GPR_ASSERT( diff --git a/test/core/end2end/bad_server_response_test.cc b/test/core/end2end/bad_server_response_test.cc index 576d39b319..d323783925 100644 --- a/test/core/end2end/bad_server_response_test.cc +++ b/test/core/end2end/bad_server_response_test.cc @@ -290,7 +290,7 @@ static void run_test(const char* response_payload, GRPC_ERROR_CREATE_FROM_STATIC_STRING("Test Shutdown")); grpc_endpoint_destroy(state.tcp); cleanup_rpc(); - + grpc_core::ExecCtx::Get()->Flush(); test_tcp_server_destroy(&test_server); grpc_shutdown(); diff --git a/test/core/iomgr/resource_quota_test.cc b/test/core/iomgr/resource_quota_test.cc index b44e8ce1be..7d793937b2 100644 --- a/test/core/iomgr/resource_quota_test.cc +++ b/test/core/iomgr/resource_quota_test.cc @@ -154,7 +154,7 @@ static void test_simple_async_alloc(void) { gpr_event_init(&ev); grpc_core::ExecCtx _local_exec_ctx; grpc_resource_user_alloc(usr, 1024, set_event(&ev)); - + grpc_core::ExecCtx::Get()->Flush(); GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) != nullptr); } @@ -177,7 +177,7 @@ static void test_async_alloc_blocked_by_size(void) { { grpc_core::ExecCtx _local_exec_ctx; grpc_resource_user_alloc(usr, 1024, set_event(&ev)); - + grpc_core::ExecCtx::Get()->Flush(); GPR_ASSERT(gpr_event_wait( &ev, grpc_timeout_milliseconds_to_deadline(100)) == nullptr); } @@ -204,7 +204,7 @@ static void test_scavenge(void) { gpr_event_init(&ev); grpc_core::ExecCtx _local_exec_ctx; grpc_resource_user_alloc(usr1, 1024, set_event(&ev)); - + grpc_core::ExecCtx::Get()->Flush(); GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) != nullptr); ; @@ -218,7 +218,7 @@ static void test_scavenge(void) { gpr_event_init(&ev); grpc_core::ExecCtx _local_exec_ctx; grpc_resource_user_alloc(usr2, 1024, set_event(&ev)); - + grpc_core::ExecCtx::Get()->Flush(); GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) != nullptr); ; @@ -243,7 +243,7 @@ static void test_scavenge_blocked(void) { gpr_event_init(&ev); grpc_core::ExecCtx _local_exec_ctx; grpc_resource_user_alloc(usr1, 1024, set_event(&ev)); - + grpc_core::ExecCtx::Get()->Flush(); GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) != nullptr); ; @@ -252,14 +252,14 @@ static void test_scavenge_blocked(void) { gpr_event_init(&ev); grpc_core::ExecCtx _local_exec_ctx; grpc_resource_user_alloc(usr2, 1024, set_event(&ev)); - + grpc_core::ExecCtx::Get()->Flush(); GPR_ASSERT(gpr_event_wait( &ev, grpc_timeout_milliseconds_to_deadline(100)) == nullptr); } { grpc_core::ExecCtx _local_exec_ctx; grpc_resource_user_free(usr1, 1024); - + grpc_core::ExecCtx::Get()->Flush(); GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) != nullptr); ; @@ -284,7 +284,7 @@ static void test_blocked_until_scheduled_reclaim(void) { gpr_event_init(&ev); grpc_core::ExecCtx _local_exec_ctx; grpc_resource_user_alloc(usr, 1024, set_event(&ev)); - + grpc_core::ExecCtx::Get()->Flush(); GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) != nullptr); ; @@ -301,7 +301,7 @@ static void test_blocked_until_scheduled_reclaim(void) { gpr_event_init(&ev); grpc_core::ExecCtx _local_exec_ctx; grpc_resource_user_alloc(usr, 1024, set_event(&ev)); - + grpc_core::ExecCtx::Get()->Flush(); GPR_ASSERT(gpr_event_wait(&reclaim_done, grpc_timeout_seconds_to_deadline(5)) != nullptr); GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) != @@ -328,7 +328,7 @@ static void test_blocked_until_scheduled_reclaim_and_scavenge(void) { gpr_event_init(&ev); grpc_core::ExecCtx _local_exec_ctx; grpc_resource_user_alloc(usr1, 1024, set_event(&ev)); - + grpc_core::ExecCtx::Get()->Flush(); GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) != nullptr); ; @@ -345,7 +345,7 @@ static void test_blocked_until_scheduled_reclaim_and_scavenge(void) { gpr_event_init(&ev); grpc_core::ExecCtx _local_exec_ctx; grpc_resource_user_alloc(usr2, 1024, set_event(&ev)); - + grpc_core::ExecCtx::Get()->Flush(); GPR_ASSERT(gpr_event_wait(&reclaim_done, grpc_timeout_seconds_to_deadline(5)) != nullptr); GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) != @@ -372,7 +372,7 @@ static void test_blocked_until_scheduled_destructive_reclaim(void) { gpr_event_init(&ev); grpc_core::ExecCtx _local_exec_ctx; grpc_resource_user_alloc(usr, 1024, set_event(&ev)); - + grpc_core::ExecCtx::Get()->Flush(); GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) != nullptr); ; @@ -389,7 +389,7 @@ static void test_blocked_until_scheduled_destructive_reclaim(void) { gpr_event_init(&ev); grpc_core::ExecCtx _local_exec_ctx; grpc_resource_user_alloc(usr, 1024, set_event(&ev)); - + grpc_core::ExecCtx::Get()->Flush(); GPR_ASSERT(gpr_event_wait(&reclaim_done, grpc_timeout_seconds_to_deadline(5)) != nullptr); GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) != @@ -420,7 +420,7 @@ static void test_unused_reclaim_is_cancelled(void) { usr, false, make_unused_reclaimer(set_event(&benign_done))); grpc_resource_user_post_reclaimer( usr, true, make_unused_reclaimer(set_event(&destructive_done))); - + grpc_core::ExecCtx::Get()->Flush(); GPR_ASSERT(gpr_event_wait(&benign_done, grpc_timeout_milliseconds_to_deadline(100)) == nullptr); @@ -451,7 +451,7 @@ static void test_benign_reclaim_is_preferred(void) { gpr_event_init(&ev); grpc_core::ExecCtx _local_exec_ctx; grpc_resource_user_alloc(usr, 1024, set_event(&ev)); - + grpc_core::ExecCtx::Get()->Flush(); GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) != nullptr); ; @@ -462,7 +462,7 @@ static void test_benign_reclaim_is_preferred(void) { usr, false, make_reclaimer(usr, 1024, set_event(&benign_done))); grpc_resource_user_post_reclaimer( usr, true, make_unused_reclaimer(set_event(&destructive_done))); - + grpc_core::ExecCtx::Get()->Flush(); GPR_ASSERT(gpr_event_wait(&benign_done, grpc_timeout_milliseconds_to_deadline(100)) == nullptr); @@ -475,7 +475,7 @@ static void test_benign_reclaim_is_preferred(void) { gpr_event_init(&ev); grpc_core::ExecCtx _local_exec_ctx; grpc_resource_user_alloc(usr, 1024, set_event(&ev)); - + grpc_core::ExecCtx::Get()->Flush(); GPR_ASSERT(gpr_event_wait(&benign_done, grpc_timeout_seconds_to_deadline(5)) != nullptr); GPR_ASSERT(gpr_event_wait(&destructive_done, @@ -511,7 +511,7 @@ static void test_multiple_reclaims_can_be_triggered(void) { gpr_event_init(&ev); grpc_core::ExecCtx _local_exec_ctx; grpc_resource_user_alloc(usr, 1024, set_event(&ev)); - + grpc_core::ExecCtx::Get()->Flush(); GPR_ASSERT(gpr_event_wait(&ev, grpc_timeout_seconds_to_deadline(5)) != nullptr); ; @@ -522,7 +522,7 @@ static void test_multiple_reclaims_can_be_triggered(void) { usr, false, make_reclaimer(usr, 512, set_event(&benign_done))); grpc_resource_user_post_reclaimer( usr, true, make_reclaimer(usr, 512, set_event(&destructive_done))); - + grpc_core::ExecCtx::Get()->Flush(); GPR_ASSERT(gpr_event_wait(&benign_done, grpc_timeout_milliseconds_to_deadline(100)) == nullptr); @@ -535,7 +535,7 @@ static void test_multiple_reclaims_can_be_triggered(void) { gpr_event_init(&ev); grpc_core::ExecCtx _local_exec_ctx; grpc_resource_user_alloc(usr, 1024, set_event(&ev)); - + grpc_core::ExecCtx::Get()->Flush(); GPR_ASSERT(gpr_event_wait(&benign_done, grpc_timeout_seconds_to_deadline(5)) != nullptr); GPR_ASSERT(gpr_event_wait(&destructive_done, @@ -597,7 +597,7 @@ test_resource_user_stays_allocated_and_reclaimers_unrun_until_memory_released( grpc_core::ExecCtx _local_exec_ctx; grpc_resource_user_post_reclaimer( usr, false, make_unused_reclaimer(set_event(&reclaimer_cancelled))); - + grpc_core::ExecCtx::Get()->Flush(); GPR_ASSERT(gpr_event_wait(&reclaimer_cancelled, grpc_timeout_milliseconds_to_deadline(100)) == nullptr); @@ -607,7 +607,7 @@ test_resource_user_stays_allocated_and_reclaimers_unrun_until_memory_released( gpr_event_init(&allocated); grpc_core::ExecCtx _local_exec_ctx; grpc_resource_user_alloc(usr, 1024, set_event(&allocated)); - + grpc_core::ExecCtx::Get()->Flush(); GPR_ASSERT(gpr_event_wait(&allocated, grpc_timeout_seconds_to_deadline(5)) != NULL); GPR_ASSERT(gpr_event_wait(&reclaimer_cancelled, @@ -617,7 +617,7 @@ test_resource_user_stays_allocated_and_reclaimers_unrun_until_memory_released( { grpc_core::ExecCtx _local_exec_ctx; grpc_resource_user_unref(usr); - + grpc_core::ExecCtx::Get()->Flush(); GPR_ASSERT(gpr_event_wait(&reclaimer_cancelled, grpc_timeout_milliseconds_to_deadline(100)) == nullptr); @@ -625,7 +625,7 @@ test_resource_user_stays_allocated_and_reclaimers_unrun_until_memory_released( { grpc_core::ExecCtx _local_exec_ctx; grpc_resource_user_free(usr, 1024); - + grpc_core::ExecCtx::Get()->Flush(); GPR_ASSERT(gpr_event_wait(&reclaimer_cancelled, grpc_timeout_seconds_to_deadline(5)) != nullptr); @@ -645,7 +645,7 @@ static void test_reclaimers_can_be_posted_repeatedly(void) { gpr_event_init(&allocated); grpc_core::ExecCtx _local_exec_ctx; grpc_resource_user_alloc(usr, 1024, set_event(&allocated)); - + grpc_core::ExecCtx::Get()->Flush(); GPR_ASSERT(gpr_event_wait(&allocated, grpc_timeout_seconds_to_deadline(5)) != nullptr); } @@ -656,7 +656,7 @@ static void test_reclaimers_can_be_posted_repeatedly(void) { grpc_core::ExecCtx _local_exec_ctx; grpc_resource_user_post_reclaimer( usr, false, make_reclaimer(usr, 1024, set_event(&reclaimer_done))); - + grpc_core::ExecCtx::Get()->Flush(); GPR_ASSERT(gpr_event_wait(&reclaimer_done, grpc_timeout_milliseconds_to_deadline(100)) == nullptr); @@ -666,7 +666,7 @@ static void test_reclaimers_can_be_posted_repeatedly(void) { gpr_event_init(&allocated); grpc_core::ExecCtx _local_exec_ctx; grpc_resource_user_alloc(usr, 1024, set_event(&allocated)); - + grpc_core::ExecCtx::Get()->Flush(); GPR_ASSERT(gpr_event_wait(&allocated, grpc_timeout_seconds_to_deadline(5)) != NULL); GPR_ASSERT(gpr_event_wait(&reclaimer_done, @@ -701,7 +701,7 @@ static void test_one_slice(void) { const int start_allocs = num_allocs; grpc_core::ExecCtx _local_exec_ctx; grpc_resource_user_alloc_slices(&alloc, 1024, 1, &buffer); - + grpc_core::ExecCtx::Get()->Flush(); assert_counter_becomes(&num_allocs, start_allocs + 1); } @@ -733,7 +733,7 @@ static void test_one_slice_deleted_late(void) { const int start_allocs = num_allocs; grpc_core::ExecCtx _local_exec_ctx; grpc_resource_user_alloc_slices(&alloc, 1024, 1, &buffer); - + grpc_core::ExecCtx::Get()->Flush(); assert_counter_becomes(&num_allocs, start_allocs + 1); } @@ -775,7 +775,7 @@ static void test_negative_rq_free_pool(void) { const int start_allocs = num_allocs; grpc_core::ExecCtx _local_exec_ctx; grpc_resource_user_alloc_slices(&alloc, 1024, 1, &buffer); - + grpc_core::ExecCtx::Get()->Flush(); assert_counter_becomes(&num_allocs, start_allocs + 1); } diff --git a/test/core/iomgr/tcp_posix_test.cc b/test/core/iomgr/tcp_posix_test.cc index 4018fe50bd..614ceaa02d 100644 --- a/test/core/iomgr/tcp_posix_test.cc +++ b/test/core/iomgr/tcp_posix_test.cc @@ -549,6 +549,7 @@ int main(int argc, char** argv) { grpc_schedule_on_exec_ctx); grpc_pollset_shutdown(g_pollset, &destroyed); + grpc_core::ExecCtx::Get()->Flush(); grpc_shutdown(); gpr_free(g_pollset); diff --git a/test/core/iomgr/tcp_server_posix_test.cc b/test/core/iomgr/tcp_server_posix_test.cc index ba9fe92c9c..a4dfa9e772 100644 --- a/test/core/iomgr/tcp_server_posix_test.cc +++ b/test/core/iomgr/tcp_server_posix_test.cc @@ -411,6 +411,7 @@ static void test_connect(size_t num_connects, GPR_ASSERT(grpc_tcp_server_port_fd(s, 0, 0) >= 0); grpc_tcp_server_unref(s); + grpc_core::ExecCtx::Get()->Flush(); /* Weak ref lost. */ GPR_ASSERT(weak_ref.server == nullptr); diff --git a/test/core/iomgr/timer_list_test.cc b/test/core/iomgr/timer_list_test.cc index a4a53a0e46..329b767f32 100644 --- a/test/core/iomgr/timer_list_test.cc +++ b/test/core/iomgr/timer_list_test.cc @@ -72,7 +72,7 @@ static void add_test(void) { /* collect timers. Only the first batch should be ready. */ grpc_core::ExecCtx::Get()->TestOnlySetNow(start + 500); GPR_ASSERT(grpc_timer_check(nullptr) == GRPC_TIMERS_FIRED); - + grpc_core::ExecCtx::Get()->Flush(); for (i = 0; i < 20; i++) { GPR_ASSERT(cb_called[i][1] == (i < 10)); GPR_ASSERT(cb_called[i][0] == 0); @@ -80,7 +80,7 @@ static void add_test(void) { grpc_core::ExecCtx::Get()->TestOnlySetNow(start + 600); GPR_ASSERT(grpc_timer_check(nullptr) == GRPC_TIMERS_CHECKED_AND_EMPTY); - + grpc_core::ExecCtx::Get()->Flush(); for (i = 0; i < 30; i++) { GPR_ASSERT(cb_called[i][1] == (i < 10)); GPR_ASSERT(cb_called[i][0] == 0); @@ -89,7 +89,7 @@ static void add_test(void) { /* collect the rest of the timers */ grpc_core::ExecCtx::Get()->TestOnlySetNow(start + 1500); GPR_ASSERT(grpc_timer_check(nullptr) == GRPC_TIMERS_FIRED); - + grpc_core::ExecCtx::Get()->Flush(); for (i = 0; i < 30; i++) { GPR_ASSERT(cb_called[i][1] == (i < 20)); GPR_ASSERT(cb_called[i][0] == 0); @@ -135,16 +135,16 @@ void destruction_test(void) { GRPC_CLOSURE_CREATE(cb, (void*)(intptr_t)4, grpc_schedule_on_exec_ctx)); grpc_core::ExecCtx::Get()->TestOnlySetNow(2); GPR_ASSERT(grpc_timer_check(nullptr) == GRPC_TIMERS_FIRED); - + grpc_core::ExecCtx::Get()->Flush(); GPR_ASSERT(1 == cb_called[4][1]); grpc_timer_cancel(&timers[0]); grpc_timer_cancel(&timers[3]); - + grpc_core::ExecCtx::Get()->Flush(); GPR_ASSERT(1 == cb_called[0][0]); GPR_ASSERT(1 == cb_called[3][0]); grpc_timer_list_shutdown(); - + grpc_core::ExecCtx::Get()->Flush(); GPR_ASSERT(1 == cb_called[1][0]); GPR_ASSERT(1 == cb_called[2][0]); } diff --git a/test/core/iomgr/udp_server_test.cc b/test/core/iomgr/udp_server_test.cc index 2c5719f4ae..e271acbeef 100644 --- a/test/core/iomgr/udp_server_test.cc +++ b/test/core/iomgr/udp_server_test.cc @@ -308,7 +308,7 @@ int main(int argc, char** argv) { GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, g_pollset, grpc_schedule_on_exec_ctx); grpc_pollset_shutdown(g_pollset, &destroyed); - + grpc_core::ExecCtx::Get()->Flush(); gpr_free(g_pollset); grpc_shutdown(); return 0; diff --git a/test/core/security/jwt_verifier_test.cc b/test/core/security/jwt_verifier_test.cc index dd798ec1d1..ec14fec697 100644 --- a/test/core/security/jwt_verifier_test.cc +++ b/test/core/security/jwt_verifier_test.cc @@ -366,7 +366,7 @@ static void test_jwt_verifier_google_email_issuer_success(void) { grpc_jwt_verifier_verify(verifier, nullptr, jwt, expected_audience, on_verification_success, (void*)expected_user_data); grpc_jwt_verifier_destroy(verifier); - + grpc_core::ExecCtx::Get()->Flush(); gpr_free(jwt); grpc_httpcli_set_override(nullptr, nullptr); } @@ -399,7 +399,7 @@ static void test_jwt_verifier_custom_email_issuer_success(void) { grpc_jwt_verifier_verify(verifier, nullptr, jwt, expected_audience, on_verification_success, (void*)expected_user_data); grpc_jwt_verifier_destroy(verifier); - + grpc_core::ExecCtx::Get()->Flush(); gpr_free(jwt); grpc_httpcli_set_override(nullptr, nullptr); } @@ -446,7 +446,7 @@ static void test_jwt_verifier_url_issuer_success(void) { grpc_jwt_verifier_verify(verifier, nullptr, jwt, expected_audience, on_verification_success, (void*)expected_user_data); grpc_jwt_verifier_destroy(verifier); - + grpc_core::ExecCtx::Get()->Flush(); gpr_free(jwt); grpc_httpcli_set_override(nullptr, nullptr); } @@ -486,7 +486,7 @@ static void test_jwt_verifier_url_issuer_bad_config(void) { on_verification_key_retrieval_error, (void*)expected_user_data); grpc_jwt_verifier_destroy(verifier); - + grpc_core::ExecCtx::Get()->Flush(); gpr_free(jwt); grpc_httpcli_set_override(nullptr, nullptr); } @@ -509,7 +509,7 @@ static void test_jwt_verifier_bad_json_key(void) { on_verification_key_retrieval_error, (void*)expected_user_data); grpc_jwt_verifier_destroy(verifier); - + grpc_core::ExecCtx::Get()->Flush(); gpr_free(jwt); grpc_httpcli_set_override(nullptr, nullptr); } @@ -562,7 +562,7 @@ static void test_jwt_verifier_bad_signature(void) { (void*)expected_user_data); gpr_free(jwt); grpc_jwt_verifier_destroy(verifier); - + grpc_core::ExecCtx::Get()->Flush(); grpc_httpcli_set_override(nullptr, nullptr); } @@ -591,7 +591,7 @@ static void test_jwt_verifier_bad_format(void) { on_verification_bad_format, (void*)expected_user_data); grpc_jwt_verifier_destroy(verifier); - + grpc_core::ExecCtx::Get()->Flush(); grpc_httpcli_set_override(nullptr, nullptr); } diff --git a/test/core/security/secure_endpoint_test.cc b/test/core/security/secure_endpoint_test.cc index 14ca0a8927..694a8584ea 100644 --- a/test/core/security/secure_endpoint_test.cc +++ b/test/core/security/secure_endpoint_test.cc @@ -181,6 +181,7 @@ static void test_leftover(grpc_endpoint_test_config config, size_t slice_size) { GRPC_CLOSURE_INIT(&done_closure, inc_call_ctr, &n, grpc_schedule_on_exec_ctx); grpc_endpoint_read(f.client_ep, &incoming, &done_closure); + grpc_core::ExecCtx::Get()->Flush(); GPR_ASSERT(n == 1); GPR_ASSERT(incoming.count == 1); GPR_ASSERT(grpc_slice_eq(s, incoming.slices[0])); diff --git a/test/core/transport/connectivity_state_test.cc b/test/core/transport/connectivity_state_test.cc index feb603cd23..99bd0fc65f 100644 --- a/test/core/transport/connectivity_state_test.cc +++ b/test/core/transport/connectivity_state_test.cc @@ -107,6 +107,7 @@ static void test_subscribe_then_destroy(void) { GPR_ASSERT(g_counter == 0); grpc_connectivity_state_destroy(&tracker); + grpc_core::ExecCtx::Get()->Flush(); GPR_ASSERT(state == GRPC_CHANNEL_SHUTDOWN); GPR_ASSERT(g_counter == 1); } @@ -126,7 +127,7 @@ static void test_subscribe_with_failure_then_destroy(void) { GPR_ASSERT(state == GRPC_CHANNEL_SHUTDOWN); GPR_ASSERT(g_counter == 0); grpc_connectivity_state_destroy(&tracker); - + grpc_core::ExecCtx::Get()->Flush(); GPR_ASSERT(state == GRPC_CHANNEL_SHUTDOWN); GPR_ASSERT(g_counter == 1); } diff --git a/test/core/util/port_server_client.cc b/test/core/util/port_server_client.cc index 7efa951862..9d0cb20bbd 100644 --- a/test/core/util/port_server_client.cc +++ b/test/core/util/port_server_client.cc @@ -241,6 +241,7 @@ int grpc_pick_port_using_server(void) { grpc_pollset_shutdown(grpc_polling_entity_pollset(&pr.pops), shutdown_closure); + grpc_core::ExecCtx::Get()->Flush(); grpc_shutdown(); return pr.port; diff --git a/test/cpp/client/client_channel_stress_test.cc b/test/cpp/client/client_channel_stress_test.cc index 8940f6ff9e..bdb0441bd7 100644 --- a/test/cpp/client/client_channel_stress_test.cc +++ b/test/cpp/client/client_channel_stress_test.cc @@ -214,13 +214,13 @@ class ClientChannelStressTest { }; void SetNextResolution(const std::vector<AddressData>& address_data) { - grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + grpc_core::ExecCtx exec_ctx; grpc_lb_addresses* addresses = grpc_lb_addresses_create(address_data.size(), nullptr); for (size_t i = 0; i < address_data.size(); ++i) { char* lb_uri_str; gpr_asprintf(&lb_uri_str, "ipv4:127.0.0.1:%d", address_data[i].port); - grpc_uri* lb_uri = grpc_uri_parse(&exec_ctx, lb_uri_str, true); + grpc_uri* lb_uri = grpc_uri_parse(lb_uri_str, true); GPR_ASSERT(lb_uri != nullptr); grpc_lb_addresses_set_address_from_uri( addresses, i, lb_uri, address_data[i].is_balancer, @@ -230,10 +230,9 @@ class ClientChannelStressTest { } grpc_arg fake_addresses = grpc_lb_addresses_create_channel_arg(addresses); grpc_channel_args fake_result = {1, &fake_addresses}; - grpc_fake_resolver_response_generator_set_response( - &exec_ctx, response_generator_, &fake_result); - grpc_lb_addresses_destroy(&exec_ctx, addresses); - grpc_exec_ctx_finish(&exec_ctx); + grpc_fake_resolver_response_generator_set_response(response_generator_, + &fake_result); + grpc_lb_addresses_destroy(addresses); } void KeepSendingRequests() { |