diff options
author | Craig Tiller <ctiller@google.com> | 2017-07-21 13:14:14 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2017-07-21 13:14:14 -0700 |
commit | 9a8c3f398aed287decf6f8966a46478624f7c4f1 (patch) | |
tree | 24a432d49022cbaf7b901c9de3020d2409f1d690 /test/core/iomgr | |
parent | 9d0463b3f34f46f7527589480f55a8cdb21d42e7 (diff) |
Explicitly call out round up vs round down
Diffstat (limited to 'test/core/iomgr')
-rw-r--r-- | test/core/iomgr/endpoint_tests.c | 4 | ||||
-rw-r--r-- | test/core/iomgr/resolve_address_posix_test.c | 3 | ||||
-rw-r--r-- | test/core/iomgr/resolve_address_test.c | 3 | ||||
-rw-r--r-- | test/core/iomgr/tcp_client_posix_test.c | 8 | ||||
-rw-r--r-- | test/core/iomgr/tcp_posix_test.c | 10 | ||||
-rw-r--r-- | test/core/iomgr/tcp_server_posix_test.c | 2 | ||||
-rw-r--r-- | test/core/iomgr/udp_server_test.c | 3 |
7 files changed, 18 insertions, 15 deletions
diff --git a/test/core/iomgr/endpoint_tests.c b/test/core/iomgr/endpoint_tests.c index e80dce01cf..684858088f 100644 --- a/test/core/iomgr/endpoint_tests.c +++ b/test/core/iomgr/endpoint_tests.c @@ -176,7 +176,7 @@ static void read_and_write_test(grpc_endpoint_test_config config, begin_test(config, "read_and_write_test", slice_size); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_millis deadline = - grpc_timespec_to_millis(grpc_timeout_seconds_to_deadline(20)); + grpc_timespec_to_millis_round_up(grpc_timeout_seconds_to_deadline(20)); gpr_log(GPR_DEBUG, "num_bytes=%" PRIuPTR " write_size=%" PRIuPTR " slice_size=%" PRIuPTR " shutdown=%d", num_bytes, write_size, slice_size, shutdown); @@ -261,7 +261,7 @@ static void wait_for_fail_count(grpc_exec_ctx *exec_ctx, int *fail_count, grpc_exec_ctx_flush(exec_ctx); gpr_mu_lock(g_mu); grpc_millis deadline = - grpc_timespec_to_millis(grpc_timeout_seconds_to_deadline(10)); + grpc_timespec_to_millis_round_up(grpc_timeout_seconds_to_deadline(10)); while (grpc_exec_ctx_now(exec_ctx) < deadline && *fail_count < want_fail_count) { grpc_pollset_worker *worker = NULL; diff --git a/test/core/iomgr/resolve_address_posix_test.c b/test/core/iomgr/resolve_address_posix_test.c index d9d200d2c4..0a18ec7508 100644 --- a/test/core/iomgr/resolve_address_posix_test.c +++ b/test/core/iomgr/resolve_address_posix_test.c @@ -71,7 +71,8 @@ void args_finish(grpc_exec_ctx *exec_ctx, args_struct *args) { } static grpc_millis n_sec_deadline(int seconds) { - return grpc_timespec_to_millis(grpc_timeout_seconds_to_deadline(seconds)); + return grpc_timespec_to_millis_round_up( + grpc_timeout_seconds_to_deadline(seconds)); } static void actually_poll(void *argsp) { diff --git a/test/core/iomgr/resolve_address_test.c b/test/core/iomgr/resolve_address_test.c index c6c53be5ca..d475b552b0 100644 --- a/test/core/iomgr/resolve_address_test.c +++ b/test/core/iomgr/resolve_address_test.c @@ -68,7 +68,8 @@ void args_finish(grpc_exec_ctx *exec_ctx, args_struct *args) { } static grpc_millis n_sec_deadline(int seconds) { - return grpc_timespec_to_millis(grpc_timeout_seconds_to_deadline(seconds)); + return grpc_timespec_to_millis_round_up( + grpc_timeout_seconds_to_deadline(seconds)); } static void poll_pollset_until_request_done(args_struct *args) { diff --git a/test/core/iomgr/tcp_client_posix_test.c b/test/core/iomgr/tcp_client_posix_test.c index 69dc82f45e..3cae13ba08 100644 --- a/test/core/iomgr/tcp_client_posix_test.c +++ b/test/core/iomgr/tcp_client_posix_test.c @@ -47,7 +47,7 @@ static int g_connections_complete = 0; static grpc_endpoint *g_connecting = NULL; static grpc_millis test_deadline(void) { - return grpc_timespec_to_millis(grpc_timeout_seconds_to_deadline(10)); + return grpc_timespec_to_millis_round_up(grpc_timeout_seconds_to_deadline(10)); } static void finish_connection() { @@ -124,9 +124,9 @@ void test_succeeds(void) { grpc_pollset_worker *worker = NULL; GPR_ASSERT(GRPC_LOG_IF_ERROR( "pollset_work", - grpc_pollset_work( - &exec_ctx, g_pollset, &worker, - grpc_timespec_to_millis(grpc_timeout_seconds_to_deadline(5))))); + grpc_pollset_work(&exec_ctx, g_pollset, &worker, + grpc_timespec_to_millis_round_up( + grpc_timeout_seconds_to_deadline(5))))); gpr_mu_unlock(g_mu); grpc_exec_ctx_flush(&exec_ctx); gpr_mu_lock(g_mu); diff --git a/test/core/iomgr/tcp_posix_test.c b/test/core/iomgr/tcp_posix_test.c index aa55b71725..03b707c247 100644 --- a/test/core/iomgr/tcp_posix_test.c +++ b/test/core/iomgr/tcp_posix_test.c @@ -162,7 +162,7 @@ static void read_test(size_t num_bytes, size_t slice_size) { struct read_socket_state state; size_t written_bytes; grpc_millis deadline = - grpc_timespec_to_millis(grpc_timeout_seconds_to_deadline(20)); + grpc_timespec_to_millis_round_up(grpc_timeout_seconds_to_deadline(20)); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; gpr_log(GPR_INFO, "Read test of size %" PRIuPTR ", slice size %" PRIuPTR, @@ -215,7 +215,7 @@ static void large_read_test(size_t slice_size) { struct read_socket_state state; ssize_t written_bytes; grpc_millis deadline = - grpc_timespec_to_millis(grpc_timeout_seconds_to_deadline(20)); + grpc_timespec_to_millis_round_up(grpc_timeout_seconds_to_deadline(20)); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; gpr_log(GPR_INFO, "Start large read test, slice size %" PRIuPTR, slice_size); @@ -318,7 +318,7 @@ void drain_socket_blocking(int fd, size_t num_bytes, size_t read_size) { GPR_ASSERT(GRPC_LOG_IF_ERROR( "pollset_work", grpc_pollset_work(&exec_ctx, g_pollset, &worker, - grpc_timespec_to_millis( + grpc_timespec_to_millis_round_up( grpc_timeout_milliseconds_to_deadline(10))))); gpr_mu_unlock(g_mu); grpc_exec_ctx_finish(&exec_ctx); @@ -353,7 +353,7 @@ static void write_test(size_t num_bytes, size_t slice_size) { grpc_slice_buffer outgoing; grpc_closure write_done_closure; grpc_millis deadline = - grpc_timespec_to_millis(grpc_timeout_seconds_to_deadline(20)); + grpc_timespec_to_millis_round_up(grpc_timeout_seconds_to_deadline(20)); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; gpr_log(GPR_INFO, @@ -419,7 +419,7 @@ static void release_fd_test(size_t num_bytes, size_t slice_size) { size_t written_bytes; int fd; grpc_millis deadline = - grpc_timespec_to_millis(grpc_timeout_seconds_to_deadline(20)); + grpc_timespec_to_millis_round_up(grpc_timeout_seconds_to_deadline(20)); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_closure fd_released_cb; int fd_released_done = 0; diff --git a/test/core/iomgr/tcp_server_posix_test.c b/test/core/iomgr/tcp_server_posix_test.c index 13ff92cb5b..0cde2d0e72 100644 --- a/test/core/iomgr/tcp_server_posix_test.c +++ b/test/core/iomgr/tcp_server_posix_test.c @@ -231,7 +231,7 @@ static void test_no_op_with_port_and_start(void) { static grpc_error *tcp_connect(grpc_exec_ctx *exec_ctx, const test_addr *remote, on_connect_result *result) { grpc_millis deadline = - grpc_timespec_to_millis(grpc_timeout_seconds_to_deadline(10)); + grpc_timespec_to_millis_round_up(grpc_timeout_seconds_to_deadline(10)); int clifd; int nconnects_before; const struct sockaddr *remote_addr = diff --git a/test/core/iomgr/udp_server_test.c b/test/core/iomgr/udp_server_test.c index 2f6f503443..5977da3d44 100644 --- a/test/core/iomgr/udp_server_test.c +++ b/test/core/iomgr/udp_server_test.c @@ -252,7 +252,8 @@ static void test_receive(int number_of_clients) { gpr_mu_lock(g_mu); for (i = 0; i < number_of_clients; i++) { - deadline = grpc_timespec_to_millis(grpc_timeout_seconds_to_deadline(10)); + deadline = + grpc_timespec_to_millis_round_up(grpc_timeout_seconds_to_deadline(10)); number_of_reads_before = g_number_of_reads; /* Create a socket, send a packet to the UDP server. */ |