diff options
Diffstat (limited to 'test/core/iomgr')
-rw-r--r-- | test/core/iomgr/endpoint_tests.c | 20 | ||||
-rw-r--r-- | test/core/iomgr/tcp_server_posix_test.c | 3 |
2 files changed, 9 insertions, 14 deletions
diff --git a/test/core/iomgr/endpoint_tests.c b/test/core/iomgr/endpoint_tests.c index 02618dfd66..31743167cd 100644 --- a/test/core/iomgr/endpoint_tests.c +++ b/test/core/iomgr/endpoint_tests.c @@ -151,18 +151,12 @@ static void read_and_write_test_write_handler(void *data, int success, size_t nslices; if (success) { - for (;;) { - /* Need to do inline writes until they don't succeed synchronously or we - finish writing */ - state->bytes_written += state->current_write_size; - if (state->target_bytes - state->bytes_written < - state->current_write_size) { - state->current_write_size = state->target_bytes - state->bytes_written; - } - if (state->current_write_size == 0) { - break; - } - + state->bytes_written += state->current_write_size; + if (state->target_bytes - state->bytes_written < + state->current_write_size) { + state->current_write_size = state->target_bytes - state->bytes_written; + } + if (state->current_write_size != 0) { slices = allocate_blocks(state->current_write_size, 8192, &nslices, &state->current_write_data); gpr_slice_buffer_reset_and_unref(&state->outgoing); @@ -170,8 +164,8 @@ static void read_and_write_test_write_handler(void *data, int success, grpc_endpoint_write(state->write_ep, &state->outgoing, &state->done_write, call_list); free(slices); + return; } - GPR_ASSERT(state->bytes_written == state->target_bytes); } gpr_log(GPR_INFO, "Write handler done"); diff --git a/test/core/iomgr/tcp_server_posix_test.c b/test/core/iomgr/tcp_server_posix_test.c index b80506bc51..6ce78d2088 100644 --- a/test/core/iomgr/tcp_server_posix_test.c +++ b/test/core/iomgr/tcp_server_posix_test.c @@ -159,7 +159,8 @@ static void test_connect(int n) { gpr_mu_unlock(GRPC_POLLSET_MU(&g_pollset)); - grpc_tcp_server_destroy(s, NULL, NULL); + grpc_tcp_server_destroy(s, NULL, &call_list); + grpc_call_list_run(&call_list); } static void destroy_pollset(void *p, int success, grpc_call_list *call_list) { |