diff --git a/Makefile b/Makefile index 5ed74409122..13a28b9797c 100644 --- a/Makefile +++ b/Makefile @@ -111,7 +111,6 @@ LDXX_helgrind = $(DEFAULT_CXX) CPPFLAGS_helgrind = -O0 LDFLAGS_helgrind = -rdynamic DEFINES_helgrind = _DEBUG DEBUG -DEFINES_helgrind += GRPC_TEST_SLOWDOWN_BUILD_FACTOR=20 VALID_CONFIG_asan-noleaks = 1 REQUIRE_CUSTOM_LIBRARIES_asan-noleaks = 1 @@ -121,7 +120,6 @@ LD_asan-noleaks = clang LDXX_asan-noleaks = clang++ CPPFLAGS_asan-noleaks = -O0 -fsanitize-coverage=edge -fsanitize=address -fno-omit-frame-pointer -Wno-unused-command-line-argument -DGPR_NO_DIRECT_SYSCALLS LDFLAGS_asan-noleaks = -fsanitize=address -DEFINES_asan-noleaks += GRPC_TEST_SLOWDOWN_BUILD_FACTOR=3 VALID_CONFIG_asan-trace-cmp = 1 REQUIRE_CUSTOM_LIBRARIES_asan-trace-cmp = 1 @@ -131,7 +129,6 @@ LD_asan-trace-cmp = clang LDXX_asan-trace-cmp = clang++ CPPFLAGS_asan-trace-cmp = -O0 -fsanitize-coverage=edge -fsanitize-coverage=trace-cmp -fsanitize=address -fno-omit-frame-pointer -Wno-unused-command-line-argument -DGPR_NO_DIRECT_SYSCALLS LDFLAGS_asan-trace-cmp = -fsanitize=address -DEFINES_asan-trace-cmp += GRPC_TEST_SLOWDOWN_BUILD_FACTOR=3 VALID_CONFIG_dbg = 1 CC_dbg = $(DEFAULT_CC) @@ -166,7 +163,6 @@ LDXX_memcheck = $(DEFAULT_CXX) CPPFLAGS_memcheck = -O0 LDFLAGS_memcheck = -rdynamic DEFINES_memcheck = _DEBUG DEBUG -DEFINES_memcheck += GRPC_TEST_SLOWDOWN_BUILD_FACTOR=10 VALID_CONFIG_asan = 1 REQUIRE_CUSTOM_LIBRARIES_asan = 1 @@ -176,7 +172,6 @@ LD_asan = clang LDXX_asan = clang++ CPPFLAGS_asan = -O0 -fsanitize-coverage=edge -fsanitize=address -fno-omit-frame-pointer -Wno-unused-command-line-argument -DGPR_NO_DIRECT_SYSCALLS LDFLAGS_asan = -fsanitize=address -DEFINES_asan += GRPC_TEST_SLOWDOWN_BUILD_FACTOR=3 VALID_CONFIG_tsan = 1 REQUIRE_CUSTOM_LIBRARIES_tsan = 1 @@ -187,7 +182,6 @@ LDXX_tsan = clang++ CPPFLAGS_tsan = -O0 -fsanitize=thread -fno-omit-frame-pointer -Wno-unused-command-line-argument -DGPR_NO_DIRECT_SYSCALLS LDFLAGS_tsan = -fsanitize=thread DEFINES_tsan = GRPC_TSAN -DEFINES_tsan += GRPC_TEST_SLOWDOWN_BUILD_FACTOR=5 VALID_CONFIG_ubsan = 1 REQUIRE_CUSTOM_LIBRARIES_ubsan = 1 @@ -198,7 +192,6 @@ LDXX_ubsan = clang++ CPPFLAGS_ubsan = -O0 -fsanitize-coverage=edge -fsanitize=undefined,unsigned-integer-overflow -fno-omit-frame-pointer -Wno-unused-command-line-argument -Wvarargs LDFLAGS_ubsan = -fsanitize=undefined,unsigned-integer-overflow DEFINES_ubsan = NDEBUG -DEFINES_ubsan += GRPC_TEST_SLOWDOWN_BUILD_FACTOR=1.5 VALID_CONFIG_msan = 1 REQUIRE_CUSTOM_LIBRARIES_msan = 1 @@ -209,7 +202,6 @@ LDXX_msan = clang++ CPPFLAGS_msan = -O0 -fsanitize-coverage=edge -fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer -DGTEST_HAS_TR1_TUPLE=0 -DGTEST_USE_OWN_TR1_TUPLE=1 -Wno-unused-command-line-argument -fPIE -pie -DGPR_NO_DIRECT_SYSCALLS LDFLAGS_msan = -fsanitize=memory -DGTEST_HAS_TR1_TUPLE=0 -DGTEST_USE_OWN_TR1_TUPLE=1 -fPIE -pie $(if $(JENKINS_BUILD),-Wl$(comma)-Ttext-segment=0x7e0000000000,) DEFINES_msan = NDEBUG -DEFINES_msan += GRPC_TEST_SLOWDOWN_BUILD_FACTOR=4 VALID_CONFIG_mutrace = 1 CC_mutrace = $(DEFAULT_CC) diff --git a/build.yaml b/build.yaml index 59678324c26..944d4ecee66 100644 --- a/build.yaml +++ b/build.yaml @@ -3757,7 +3757,6 @@ configs: test_environ: ASAN_OPTIONS: detect_leaks=1:color=always LSAN_OPTIONS: suppressions=tools/lsan_suppressions.txt:report_objects=1 - timeout_multiplier: 3 asan-noleaks: CC: clang CPPFLAGS: -O0 -fsanitize-coverage=edge -fsanitize=address -fno-omit-frame-pointer @@ -3769,7 +3768,6 @@ configs: compile_the_world: true test_environ: ASAN_OPTIONS: detect_leaks=0:color=always - timeout_multiplier: 3 asan-trace-cmp: CC: clang CPPFLAGS: -O0 -fsanitize-coverage=edge -fsanitize-coverage=trace-cmp -fsanitize=address @@ -3782,7 +3780,6 @@ configs: test_environ: ASAN_OPTIONS: detect_leaks=1:color=always LSAN_OPTIONS: suppressions=tools/lsan_suppressions.txt:report_objects=1 - timeout_multiplier: 3 basicprof: CPPFLAGS: -O2 -DGRPC_BASIC_PROFILER -DGRPC_TIMERS_RDTSC DEFINES: NDEBUG @@ -3801,13 +3798,11 @@ configs: CPPFLAGS: -O0 DEFINES: _DEBUG DEBUG LDFLAGS: -rdynamic - timeout_multiplier: 20 valgrind: --tool=helgrind memcheck: CPPFLAGS: -O0 DEFINES: _DEBUG DEBUG LDFLAGS: -rdynamic - timeout_multiplier: 10 valgrind: --tool=memcheck --leak-check=full msan: CC: clang @@ -3821,7 +3816,6 @@ configs: -fPIE -pie $(if $(JENKINS_BUILD),-Wl$(comma)-Ttext-segment=0x7e0000000000,) LDXX: clang++ compile_the_world: true - timeout_multiplier: 4 mutrace: CPPFLAGS: -O3 -fno-omit-frame-pointer DEFINES: NDEBUG @@ -3844,7 +3838,6 @@ configs: compile_the_world: true test_environ: TSAN_OPTIONS: suppressions=tools/tsan_suppressions.txt:halt_on_error=1:second_deadlock_stack=1 - timeout_multiplier: 5 ubsan: CC: clang CPPFLAGS: -O0 -fsanitize-coverage=edge -fsanitize=undefined,unsigned-integer-overflow @@ -3857,7 +3850,6 @@ configs: compile_the_world: true test_environ: UBSAN_OPTIONS: halt_on_error=1:print_stacktrace=1 - timeout_multiplier: 1.5 defaults: benchmark: CPPFLAGS: -Ithird_party/benchmark/include -DHAVE_POSIX_REGEX diff --git a/src/objective-c/tests/CronetUnitTests/CronetUnitTests.m b/src/objective-c/tests/CronetUnitTests/CronetUnitTests.m index 43b91a072b8..599f840567a 100644 --- a/src/objective-c/tests/CronetUnitTests/CronetUnitTests.m +++ b/src/objective-c/tests/CronetUnitTests/CronetUnitTests.m @@ -54,7 +54,7 @@ static void drain_cq(grpc_completion_queue *cq) { grpc_event ev; do { - ev = grpc_completion_queue_next(cq, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL); + ev = grpc_completion_queue_next(cq, grpc_timeout_seconds_to_deadline(5), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } @@ -97,7 +97,7 @@ static void drain_cq(grpc_completion_queue *cq) { grpc_slice_from_copied_string("hello world"); grpc_byte_buffer *request_payload = grpc_raw_byte_buffer_create(&request_payload_slice, 1); - gpr_timespec deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5); + gpr_timespec deadline = grpc_timeout_seconds_to_deadline(5); grpc_metadata meta_c[2] = { {"key1", "val1", 4, 0, {{NULL, NULL, NULL, NULL}}}, {"key2", "val2", 4, 0, {{NULL, NULL, NULL, NULL}}}}; diff --git a/templates/Makefile.template b/templates/Makefile.template index 6f4db26f2bf..10d7861f03d 100644 --- a/templates/Makefile.template +++ b/templates/Makefile.template @@ -135,9 +135,6 @@ ${arg}_${name} = ${args.get(arg)} % endif % endfor - % if args.get('timeout_multiplier', 1) != 1: - DEFINES_${name} += GRPC_TEST_SLOWDOWN_BUILD_FACTOR=${args.timeout_multiplier} - % endif % endfor diff --git a/test/core/bad_client/bad_client.c b/test/core/bad_client/bad_client.c index b7e7606b184..fdedfe284e2 100644 --- a/test/core/bad_client/bad_client.c +++ b/test/core/bad_client/bad_client.c @@ -160,7 +160,7 @@ void grpc_run_bad_client_test( /* Await completion */ GPR_ASSERT( - gpr_event_wait(&a.done_write, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5))); + gpr_event_wait(&a.done_write, grpc_timeout_seconds_to_deadline(5))); if (flags & GRPC_BAD_CLIENT_DISCONNECT) { grpc_endpoint_shutdown(&exec_ctx, sfd.client, @@ -170,7 +170,7 @@ void grpc_run_bad_client_test( sfd.client = NULL; } - GPR_ASSERT(gpr_event_wait(&a.done_thd, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5))); + GPR_ASSERT(gpr_event_wait(&a.done_thd, grpc_timeout_seconds_to_deadline(5))); if (sfd.client != NULL) { // Validate client stream, if requested. @@ -186,7 +186,7 @@ void grpc_run_bad_client_test( &read_done_closure); grpc_exec_ctx_finish(&exec_ctx); GPR_ASSERT( - gpr_event_wait(&args.read_done, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5))); + gpr_event_wait(&args.read_done, grpc_timeout_seconds_to_deadline(5))); grpc_slice_buffer_destroy_internal(&exec_ctx, &args.incoming); } // Shutdown. @@ -197,7 +197,7 @@ void grpc_run_bad_client_test( } grpc_server_shutdown_and_notify(a.server, a.cq, NULL); GPR_ASSERT(grpc_completion_queue_pluck( - a.cq, NULL, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1), NULL) + a.cq, NULL, grpc_timeout_seconds_to_deadline(1), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(a.server); grpc_completion_queue_destroy(a.cq); diff --git a/test/core/bad_client/tests/badreq.c b/test/core/bad_client/tests/badreq.c index 5d9ffef3f20..7b22f880ab9 100644 --- a/test/core/bad_client/tests/badreq.c +++ b/test/core/bad_client/tests/badreq.c @@ -46,7 +46,7 @@ static void verifier(grpc_server *server, grpc_completion_queue *cq, void *registered_method) { while (grpc_server_has_open_connections(server)) { GPR_ASSERT(grpc_completion_queue_next( - cq, GRPC_TIMEOUT_MILLIS_TO_DEADLINE(20), NULL) + cq, grpc_timeout_milliseconds_to_deadline(20), NULL) .type == GRPC_QUEUE_TIMEOUT); } } diff --git a/test/core/bad_client/tests/connection_prefix.c b/test/core/bad_client/tests/connection_prefix.c index bc5ed2e3934..42787ab90d4 100644 --- a/test/core/bad_client/tests/connection_prefix.c +++ b/test/core/bad_client/tests/connection_prefix.c @@ -38,7 +38,7 @@ static void verifier(grpc_server *server, grpc_completion_queue *cq, void *registered_method) { while (grpc_server_has_open_connections(server)) { GPR_ASSERT(grpc_completion_queue_next( - cq, GRPC_TIMEOUT_MILLIS_TO_DEADLINE(20), NULL) + cq, grpc_timeout_milliseconds_to_deadline(20), NULL) .type == GRPC_QUEUE_TIMEOUT); } } diff --git a/test/core/bad_client/tests/headers.c b/test/core/bad_client/tests/headers.c index f872e5006a7..ab478217600 100644 --- a/test/core/bad_client/tests/headers.c +++ b/test/core/bad_client/tests/headers.c @@ -42,7 +42,7 @@ static void verifier(grpc_server *server, grpc_completion_queue *cq, void *registered_method) { while (grpc_server_has_open_connections(server)) { GPR_ASSERT(grpc_completion_queue_next( - cq, GRPC_TIMEOUT_MILLIS_TO_DEADLINE(20), NULL) + cq, grpc_timeout_milliseconds_to_deadline(20), NULL) .type == GRPC_QUEUE_TIMEOUT); } } diff --git a/test/core/bad_client/tests/initial_settings_frame.c b/test/core/bad_client/tests/initial_settings_frame.c index b84b67a7e58..890efd89241 100644 --- a/test/core/bad_client/tests/initial_settings_frame.c +++ b/test/core/bad_client/tests/initial_settings_frame.c @@ -41,7 +41,7 @@ static void verifier(grpc_server *server, grpc_completion_queue *cq, void *registered_method) { while (grpc_server_has_open_connections(server)) { GPR_ASSERT(grpc_completion_queue_next( - cq, GRPC_TIMEOUT_MILLIS_TO_DEADLINE(20), NULL) + cq, grpc_timeout_milliseconds_to_deadline(20), NULL) .type == GRPC_QUEUE_TIMEOUT); } } diff --git a/test/core/bad_client/tests/simple_request.c b/test/core/bad_client/tests/simple_request.c index db31ba6fb3c..608b849d415 100644 --- a/test/core/bad_client/tests/simple_request.c +++ b/test/core/bad_client/tests/simple_request.c @@ -130,7 +130,7 @@ static void failure_verifier(grpc_server *server, grpc_completion_queue *cq, void *registered_method) { while (grpc_server_has_open_connections(server)) { GPR_ASSERT(grpc_completion_queue_next( - cq, GRPC_TIMEOUT_MILLIS_TO_DEADLINE(20), NULL) + cq, grpc_timeout_milliseconds_to_deadline(20), NULL) .type == GRPC_QUEUE_TIMEOUT); } } diff --git a/test/core/bad_client/tests/unknown_frame.c b/test/core/bad_client/tests/unknown_frame.c index 4f483d21f2e..1d046994229 100644 --- a/test/core/bad_client/tests/unknown_frame.c +++ b/test/core/bad_client/tests/unknown_frame.c @@ -42,7 +42,7 @@ static void verifier(grpc_server *server, grpc_completion_queue *cq, void *registered_method) { while (grpc_server_has_open_connections(server)) { GPR_ASSERT(grpc_completion_queue_next( - cq, GRPC_TIMEOUT_MILLIS_TO_DEADLINE(20), NULL) + cq, grpc_timeout_milliseconds_to_deadline(20), NULL) .type == GRPC_QUEUE_TIMEOUT); } } diff --git a/test/core/bad_client/tests/window_overflow.c b/test/core/bad_client/tests/window_overflow.c index 0d17dbe448e..7db85906f95 100644 --- a/test/core/bad_client/tests/window_overflow.c +++ b/test/core/bad_client/tests/window_overflow.c @@ -61,7 +61,7 @@ static void verifier(grpc_server *server, grpc_completion_queue *cq, void *registered_method) { while (grpc_server_has_open_connections(server)) { GPR_ASSERT(grpc_completion_queue_next( - cq, GRPC_TIMEOUT_MILLIS_TO_DEADLINE(20), NULL) + cq, grpc_timeout_milliseconds_to_deadline(20), NULL) .type == GRPC_QUEUE_TIMEOUT); } } diff --git a/test/core/bad_ssl/bad_ssl_test.c b/test/core/bad_ssl/bad_ssl_test.c index 7a99f5789d9..bd855857066 100644 --- a/test/core/bad_ssl/bad_ssl_test.c +++ b/test/core/bad_ssl/bad_ssl_test.c @@ -60,7 +60,7 @@ static void run_test(const char *target, size_t nops) { grpc_slice details; grpc_status_code status; grpc_call_error error; - gpr_timespec deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5); + gpr_timespec deadline = grpc_timeout_seconds_to_deadline(5); grpc_completion_queue *cq = grpc_completion_queue_create(NULL); cq_verifier *cqv = cq_verifier_create(cq); diff --git a/test/core/bad_ssl/server_common.c b/test/core/bad_ssl/server_common.c index 14b1892c2e9..6a4313eafd6 100644 --- a/test/core/bad_ssl/server_common.c +++ b/test/core/bad_ssl/server_common.c @@ -84,7 +84,7 @@ void bad_ssl_run(grpc_server *server) { gpr_log(GPR_INFO, "Shutting down due to SIGINT"); grpc_server_shutdown_and_notify(server, cq, NULL); GPR_ASSERT(grpc_completion_queue_pluck( - cq, NULL, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + cq, NULL, grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_completion_queue_shutdown(cq); shutdown_started = 1; diff --git a/test/core/census/mlog_test.c b/test/core/census/mlog_test.c index 36e8a492fd5..e2605d12916 100644 --- a/test/core/census/mlog_test.c +++ b/test/core/census/mlog_test.c @@ -185,7 +185,7 @@ static void writer_thread(void* arg) { "written\n", args->index, records_written, args->num_records); } - gpr_sleep_until(GRPC_TIMEOUT_MILLIS_TO_DEADLINE(10)); + gpr_sleep_until(grpc_timeout_milliseconds_to_deadline(10)); } } // Done. Decrement count and signal. diff --git a/test/core/client_channel/lb_policies_test.c b/test/core/client_channel/lb_policies_test.c index 82e928ed74d..efa4ad7ee6b 100644 --- a/test/core/client_channel/lb_policies_test.c +++ b/test/core/client_channel/lb_policies_test.c @@ -327,9 +327,10 @@ static request_sequences perform_request(servers_fixture *f, grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL)); s_idx = -1; - while ((ev = grpc_completion_queue_next( - f->cq, GRPC_TIMEOUT_MILLIS_TO_DEADLINE(RETRY_TIMEOUT), NULL)) - .type != GRPC_QUEUE_TIMEOUT) { + while ( + (ev = grpc_completion_queue_next( + f->cq, grpc_timeout_milliseconds_to_deadline(RETRY_TIMEOUT), NULL)) + .type != GRPC_QUEUE_TIMEOUT) { GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); read_tag = ((int)(intptr_t)ev.tag); const grpc_connectivity_state conn_state = @@ -406,9 +407,10 @@ static request_sequences perform_request(servers_fixture *f, } } - GPR_ASSERT(grpc_completion_queue_next( - f->cq, GRPC_TIMEOUT_MILLIS_TO_DEADLINE(RETRY_TIMEOUT), NULL) - .type == GRPC_QUEUE_TIMEOUT); + GPR_ASSERT( + grpc_completion_queue_next( + f->cq, grpc_timeout_milliseconds_to_deadline(RETRY_TIMEOUT), NULL) + .type == GRPC_QUEUE_TIMEOUT); grpc_metadata_array_destroy(&rdata->initial_metadata_recv); grpc_metadata_array_destroy(&rdata->trailing_metadata_recv); @@ -563,7 +565,7 @@ static void test_ping() { READY is reached */ while (state != GRPC_CHANNEL_READY) { grpc_channel_watch_connectivity_state( - client, state, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3), f->cq, tag(99)); + client, state, grpc_timeout_seconds_to_deadline(3), f->cq, tag(99)); CQ_EXPECT_COMPLETION(cqv, tag(99), 1); cq_verify(cqv); state = grpc_channel_check_connectivity_state(client, 0); diff --git a/test/core/client_channel/resolvers/dns_resolver_connectivity_test.c b/test/core/client_channel/resolvers/dns_resolver_connectivity_test.c index f0c6843a688..cfd37052de4 100644 --- a/test/core/client_channel/resolvers/dns_resolver_connectivity_test.c +++ b/test/core/client_channel/resolvers/dns_resolver_connectivity_test.c @@ -86,7 +86,7 @@ static void on_done(grpc_exec_ctx *exec_ctx, void *ev, grpc_error *error) { static bool wait_loop(int deadline_seconds, gpr_event *ev) { while (deadline_seconds) { gpr_log(GPR_DEBUG, "Test: waiting for %d more seconds", deadline_seconds); - if (gpr_event_wait(ev, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1))) return true; + if (gpr_event_wait(ev, grpc_timeout_seconds_to_deadline(1))) return true; deadline_seconds--; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; diff --git a/test/core/end2end/connection_refused_test.c b/test/core/end2end/connection_refused_test.c index 81a6b8720d4..16a3005539b 100644 --- a/test/core/end2end/connection_refused_test.c +++ b/test/core/end2end/connection_refused_test.c @@ -53,7 +53,7 @@ static void *tag(intptr_t i) { return (void *)i; } static void run_test(bool wait_for_ready, bool use_service_config) { grpc_channel *chan; grpc_call *call; - gpr_timespec deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(2); + gpr_timespec deadline = grpc_timeout_seconds_to_deadline(2); grpc_completion_queue *cq; cq_verifier *cqv; grpc_op ops[6]; diff --git a/test/core/end2end/cq_verifier.c b/test/core/end2end/cq_verifier.c index bc2d5888f0d..9b0106ec84c 100644 --- a/test/core/end2end/cq_verifier.c +++ b/test/core/end2end/cq_verifier.c @@ -249,7 +249,7 @@ static void fail_no_event_received(cq_verifier *v) { } void cq_verify(cq_verifier *v) { - const gpr_timespec deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(10); + const gpr_timespec deadline = grpc_timeout_seconds_to_deadline(10); while (v->first_expectation != NULL) { grpc_event ev = grpc_completion_queue_next(v->cq, deadline, NULL); if (ev.type == GRPC_QUEUE_TIMEOUT) { diff --git a/test/core/end2end/cq_verifier_native.c b/test/core/end2end/cq_verifier_native.c index b1fcb4beedd..e0f1d79e835 100644 --- a/test/core/end2end/cq_verifier_native.c +++ b/test/core/end2end/cq_verifier_native.c @@ -67,7 +67,7 @@ void cq_verifier_set_first_expectation(cq_verifier *v, expectation *e) { grpc_event cq_verifier_next_event(cq_verifier *v, int timeout_seconds) { const gpr_timespec deadline = - GRPC_TIMEOUT_SECONDS_TO_DEADLINE(timeout_seconds); + grpc_timeout_seconds_to_deadline(timeout_seconds); return grpc_completion_queue_next(v->cq, deadline, NULL); } diff --git a/test/core/end2end/dualstack_socket_test.c b/test/core/end2end/dualstack_socket_test.c index 35b1b8c3d93..3623bd7be8b 100644 --- a/test/core/end2end/dualstack_socket_test.c +++ b/test/core/end2end/dualstack_socket_test.c @@ -57,7 +57,7 @@ static void *tag(intptr_t i) { return (void *)i; } static gpr_timespec ms_from_now(int ms) { - return GRPC_TIMEOUT_MILLIS_TO_DEADLINE(ms); + return grpc_timeout_milliseconds_to_deadline(ms); } static void drain_cq(grpc_completion_queue *cq) { @@ -261,7 +261,7 @@ void test_connect(const char *server_host, const char *client_host, int port, /* Destroy server. */ grpc_server_shutdown_and_notify(server, cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(server); grpc_completion_queue_shutdown(cq); diff --git a/test/core/end2end/fixtures/h2_full+trace.c b/test/core/end2end/fixtures/h2_full+trace.c index 11a102a5765..01316376e03 100644 --- a/test/core/end2end/fixtures/h2_full+trace.c +++ b/test/core/end2end/fixtures/h2_full+trace.c @@ -117,9 +117,9 @@ int main(int argc, char **argv) { gpr_setenv("GRPC_TRACE", "doesnt-exist,http,all"); #ifdef GRPC_POSIX_SOCKET - g_fixture_slowdown_factor = isatty(STDOUT_FILENO) ? 10.0 : 1.0; + g_fixture_slowdown_factor = isatty(STDOUT_FILENO) ? 10 : 1; #else - g_fixture_slowdown_factor = 10.0; + g_fixture_slowdown_factor = 10; #endif grpc_test_init(argc, argv); diff --git a/test/core/end2end/fixtures/h2_sockpair+trace.c b/test/core/end2end/fixtures/h2_sockpair+trace.c index 726ed8735c6..edf42a40702 100644 --- a/test/core/end2end/fixtures/h2_sockpair+trace.c +++ b/test/core/end2end/fixtures/h2_sockpair+trace.c @@ -154,9 +154,9 @@ int main(int argc, char **argv) { code paths in trace.c to be taken */ gpr_setenv("GRPC_TRACE", "doesnt-exist,http,all"); #ifdef GRPC_POSIX_SOCKET - g_fixture_slowdown_factor = isatty(STDOUT_FILENO) ? 10.0 : 1.0; + g_fixture_slowdown_factor = isatty(STDOUT_FILENO) ? 10 : 1; #else - g_fixture_slowdown_factor = 10.0; + g_fixture_slowdown_factor = 10; #endif grpc_test_init(argc, argv); diff --git a/test/core/end2end/fixtures/h2_sockpair_1byte.c b/test/core/end2end/fixtures/h2_sockpair_1byte.c index 11af7bee1e5..6f9cf8fe26a 100644 --- a/test/core/end2end/fixtures/h2_sockpair_1byte.c +++ b/test/core/end2end/fixtures/h2_sockpair_1byte.c @@ -144,7 +144,7 @@ static grpc_end2end_test_config configs[] = { int main(int argc, char **argv) { size_t i; - g_fixture_slowdown_factor = 2.0; + g_fixture_slowdown_factor = 2; grpc_test_init(argc, argv); grpc_end2end_tests_pre_init(); diff --git a/test/core/end2end/fixtures/h2_ssl_cert.c b/test/core/end2end/fixtures/h2_ssl_cert.c index 844e93396df..f62331eea3d 100644 --- a/test/core/end2end/fixtures/h2_ssl_cert.c +++ b/test/core/end2end/fixtures/h2_ssl_cert.c @@ -275,7 +275,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -291,7 +291,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/goaway_server_test.c b/test/core/end2end/goaway_server_test.c index 65fcb957816..c67c1f145ae 100644 --- a/test/core/end2end/goaway_server_test.c +++ b/test/core/end2end/goaway_server_test.c @@ -139,7 +139,7 @@ int main(int argc, char **argv) { grpc_call *call1 = grpc_channel_create_call(chan, NULL, GRPC_PROPAGATE_DEFAULTS, cq, grpc_slice_from_static_string("/foo"), &host, - GRPC_TIMEOUT_SECONDS_TO_DEADLINE(20), NULL); + grpc_timeout_seconds_to_deadline(20), NULL); /* send initial metadata to probe connectivity */ memset(ops, 0, sizeof(ops)); op = ops; @@ -215,7 +215,7 @@ int main(int argc, char **argv) { grpc_call *call2 = grpc_channel_create_call(chan, NULL, GRPC_PROPAGATE_DEFAULTS, cq, grpc_slice_from_static_string("/foo"), &host, - GRPC_TIMEOUT_SECONDS_TO_DEADLINE(20), NULL); + grpc_timeout_seconds_to_deadline(20), NULL); /* send initial metadata to probe connectivity */ memset(ops, 0, sizeof(ops)); op = ops; diff --git a/test/core/end2end/invalid_call_argument_test.c b/test/core/end2end/invalid_call_argument_test.c index eb6d23c350f..2a9072570d3 100644 --- a/test/core/end2end/invalid_call_argument_test.c +++ b/test/core/end2end/invalid_call_argument_test.c @@ -72,7 +72,7 @@ static void prepare_test(int is_client) { g_state.is_client = is_client; grpc_metadata_array_init(&g_state.initial_metadata_recv); grpc_metadata_array_init(&g_state.trailing_metadata_recv); - g_state.deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(2); + g_state.deadline = grpc_timeout_seconds_to_deadline(2); g_state.cq = grpc_completion_queue_create(NULL); g_state.cqv = cq_verifier_create(g_state.cq); g_state.details = grpc_empty_slice(); @@ -134,7 +134,7 @@ static void cleanup_test() { grpc_call_destroy(g_state.server_call); grpc_server_shutdown_and_notify(g_state.server, g_state.cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(g_state.cq, tag(1000), - GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), + grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(g_state.server); diff --git a/test/core/end2end/no_server_test.c b/test/core/end2end/no_server_test.c index 5c0f7a0f488..26d26d8f7a7 100644 --- a/test/core/end2end/no_server_test.c +++ b/test/core/end2end/no_server_test.c @@ -45,7 +45,7 @@ static void *tag(intptr_t i) { return (void *)i; } int main(int argc, char **argv) { grpc_channel *chan; grpc_call *call; - gpr_timespec deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(2); + gpr_timespec deadline = grpc_timeout_seconds_to_deadline(2); grpc_completion_queue *cq; cq_verifier *cqv; grpc_op ops[6]; diff --git a/test/core/end2end/tests/authority_not_supported.c b/test/core/end2end/tests/authority_not_supported.c index 4ff8acb6e7f..7db2fd6b278 100644 --- a/test/core/end2end/tests/authority_not_supported.c +++ b/test/core/end2end/tests/authority_not_supported.c @@ -58,7 +58,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -74,7 +74,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/bad_hostname.c b/test/core/end2end/tests/bad_hostname.c index 6eada3b4075..f50a5805a23 100644 --- a/test/core/end2end/tests/bad_hostname.c +++ b/test/core/end2end/tests/bad_hostname.c @@ -60,7 +60,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -76,7 +76,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/binary_metadata.c b/test/core/end2end/tests/binary_metadata.c index 9df98ea3de7..7fb60f4495b 100644 --- a/test/core/end2end/tests/binary_metadata.c +++ b/test/core/end2end/tests/binary_metadata.c @@ -58,7 +58,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -74,7 +74,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/call_creds.c b/test/core/end2end/tests/call_creds.c index 81309bb88c9..38cba50e129 100644 --- a/test/core/end2end/tests/call_creds.c +++ b/test/core/end2end/tests/call_creds.c @@ -76,7 +76,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -92,7 +92,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/cancel_after_accept.c b/test/core/end2end/tests/cancel_after_accept.c index a8127c01e8f..1a92aa48378 100644 --- a/test/core/end2end/tests/cancel_after_accept.c +++ b/test/core/end2end/tests/cancel_after_accept.c @@ -65,7 +65,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -81,7 +81,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/cancel_after_client_done.c b/test/core/end2end/tests/cancel_after_client_done.c index d3beb046c7e..0afeecb037b 100644 --- a/test/core/end2end/tests/cancel_after_client_done.c +++ b/test/core/end2end/tests/cancel_after_client_done.c @@ -59,7 +59,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -75,7 +75,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/cancel_after_invoke.c b/test/core/end2end/tests/cancel_after_invoke.c index 2f091cb2e1e..8a96ef2f894 100644 --- a/test/core/end2end/tests/cancel_after_invoke.c +++ b/test/core/end2end/tests/cancel_after_invoke.c @@ -61,7 +61,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -77,7 +77,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/cancel_before_invoke.c b/test/core/end2end/tests/cancel_before_invoke.c index e61a8383532..586aa7ead37 100644 --- a/test/core/end2end/tests/cancel_before_invoke.c +++ b/test/core/end2end/tests/cancel_before_invoke.c @@ -58,7 +58,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -74,7 +74,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/cancel_in_a_vacuum.c b/test/core/end2end/tests/cancel_in_a_vacuum.c index 98d02a56f72..bc462ddcf56 100644 --- a/test/core/end2end/tests/cancel_in_a_vacuum.c +++ b/test/core/end2end/tests/cancel_in_a_vacuum.c @@ -59,7 +59,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -75,7 +75,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/cancel_with_status.c b/test/core/end2end/tests/cancel_with_status.c index a5388444bc0..7d03fe5580f 100644 --- a/test/core/end2end/tests/cancel_with_status.c +++ b/test/core/end2end/tests/cancel_with_status.c @@ -60,7 +60,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -76,7 +76,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/compressed_payload.c b/test/core/end2end/tests/compressed_payload.c index 62cdb419419..7dd8c112d11 100644 --- a/test/core/end2end/tests/compressed_payload.c +++ b/test/core/end2end/tests/compressed_payload.c @@ -66,7 +66,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -82,7 +82,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/connectivity.c b/test/core/end2end/tests/connectivity.c index 42475c7331d..979419a100a 100644 --- a/test/core/end2end/tests/connectivity.c +++ b/test/core/end2end/tests/connectivity.c @@ -89,7 +89,7 @@ static void test_connectivity(grpc_end2end_test_config config) { /* channels should start life in IDLE, and stay there */ GPR_ASSERT(grpc_channel_check_connectivity_state(f.client, 0) == GRPC_CHANNEL_IDLE); - gpr_sleep_until(GRPC_TIMEOUT_MILLIS_TO_DEADLINE(100)); + gpr_sleep_until(grpc_timeout_milliseconds_to_deadline(100)); GPR_ASSERT(grpc_channel_check_connectivity_state(f.client, 0) == GRPC_CHANNEL_IDLE); @@ -106,7 +106,7 @@ static void test_connectivity(grpc_end2end_test_config config) { GRPC_CHANNEL_IDLE); /* start watching for a change */ grpc_channel_watch_connectivity_state(f.client, GRPC_CHANNEL_IDLE, - GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3), + grpc_timeout_seconds_to_deadline(3), f.cq, tag(2)); /* and now the watch should trigger */ @@ -118,7 +118,7 @@ static void test_connectivity(grpc_end2end_test_config config) { /* quickly followed by a transition to TRANSIENT_FAILURE */ grpc_channel_watch_connectivity_state(f.client, GRPC_CHANNEL_CONNECTING, - GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3), + grpc_timeout_seconds_to_deadline(3), f.cq, tag(3)); CQ_EXPECT_COMPLETION(cqv, tag(3), 1); cq_verify(cqv); @@ -137,7 +137,7 @@ static void test_connectivity(grpc_end2end_test_config config) { READY is reached */ while (state != GRPC_CHANNEL_READY) { grpc_channel_watch_connectivity_state( - f.client, state, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3), f.cq, tag(4)); + f.client, state, grpc_timeout_seconds_to_deadline(3), f.cq, tag(4)); CQ_EXPECT_COMPLETION(cqv, tag(4), 1); cq_verify(cqv); state = grpc_channel_check_connectivity_state(f.client, 0); @@ -151,7 +151,7 @@ static void test_connectivity(grpc_end2end_test_config config) { gpr_log(GPR_DEBUG, "*** SHUTTING DOWN SERVER ***"); grpc_channel_watch_connectivity_state(f.client, GRPC_CHANNEL_READY, - GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3), + grpc_timeout_seconds_to_deadline(3), f.cq, tag(5)); grpc_server_shutdown_and_notify(f.server, f.cq, tag(0xdead)); diff --git a/test/core/end2end/tests/default_host.c b/test/core/end2end/tests/default_host.c index b84eaf21ee2..bc1829b24b7 100644 --- a/test/core/end2end/tests/default_host.c +++ b/test/core/end2end/tests/default_host.c @@ -60,7 +60,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -76,7 +76,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/disappearing_server.c b/test/core/end2end/tests/disappearing_server.c index 6d61c66df51..05440a6f56c 100644 --- a/test/core/end2end/tests/disappearing_server.c +++ b/test/core/end2end/tests/disappearing_server.c @@ -46,7 +46,7 @@ static void *tag(intptr_t t) { return (void *)t; } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } diff --git a/test/core/end2end/tests/empty_batch.c b/test/core/end2end/tests/empty_batch.c index 1ac6ea84ec6..50bb6b849e1 100644 --- a/test/core/end2end/tests/empty_batch.c +++ b/test/core/end2end/tests/empty_batch.c @@ -60,7 +60,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -76,7 +76,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/filter_call_init_fails.c b/test/core/end2end/tests/filter_call_init_fails.c index 02add7a79a8..7e189164b2a 100644 --- a/test/core/end2end/tests/filter_call_init_fails.c +++ b/test/core/end2end/tests/filter_call_init_fails.c @@ -66,7 +66,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -82,7 +82,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/filter_causes_close.c b/test/core/end2end/tests/filter_causes_close.c index a91b3dc1ec4..308b4de71b8 100644 --- a/test/core/end2end/tests/filter_causes_close.c +++ b/test/core/end2end/tests/filter_causes_close.c @@ -63,7 +63,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -79,7 +79,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/filter_latency.c b/test/core/end2end/tests/filter_latency.c index 5bc6313813d..13d2ae012cf 100644 --- a/test/core/end2end/tests/filter_latency.c +++ b/test/core/end2end/tests/filter_latency.c @@ -70,7 +70,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -86,7 +86,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/graceful_server_shutdown.c b/test/core/end2end/tests/graceful_server_shutdown.c index c5e3667c7c3..a3ad260cc22 100644 --- a/test/core/end2end/tests/graceful_server_shutdown.c +++ b/test/core/end2end/tests/graceful_server_shutdown.c @@ -58,7 +58,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } diff --git a/test/core/end2end/tests/high_initial_seqno.c b/test/core/end2end/tests/high_initial_seqno.c index c9eae13e482..cca8532b0e0 100644 --- a/test/core/end2end/tests/high_initial_seqno.c +++ b/test/core/end2end/tests/high_initial_seqno.c @@ -62,7 +62,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -78,7 +78,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/hpack_size.c b/test/core/end2end/tests/hpack_size.c index 1376ba08259..7601722deea 100644 --- a/test/core/end2end/tests/hpack_size.c +++ b/test/core/end2end/tests/hpack_size.c @@ -202,7 +202,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -218,7 +218,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/idempotent_request.c b/test/core/end2end/tests/idempotent_request.c index 65accbb7891..cef2e100be9 100644 --- a/test/core/end2end/tests/idempotent_request.c +++ b/test/core/end2end/tests/idempotent_request.c @@ -60,7 +60,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -76,7 +76,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/invoke_large_request.c b/test/core/end2end/tests/invoke_large_request.c index ed16904728b..d799bd8ccf9 100644 --- a/test/core/end2end/tests/invoke_large_request.c +++ b/test/core/end2end/tests/invoke_large_request.c @@ -59,7 +59,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static void drain_cq(grpc_completion_queue *cq) { @@ -73,7 +73,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/large_metadata.c b/test/core/end2end/tests/large_metadata.c index dac9c3b92a5..ac4c0e7f3b4 100644 --- a/test/core/end2end/tests/large_metadata.c +++ b/test/core/end2end/tests/large_metadata.c @@ -58,7 +58,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -74,7 +74,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/load_reporting_hook.c b/test/core/end2end/tests/load_reporting_hook.c index 3db51141a6d..085a563fb8f 100644 --- a/test/core/end2end/tests/load_reporting_hook.c +++ b/test/core/end2end/tests/load_reporting_hook.c @@ -84,7 +84,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -100,7 +100,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/max_concurrent_streams.c b/test/core/end2end/tests/max_concurrent_streams.c index 37d044cefc4..bd2d69513b0 100644 --- a/test/core/end2end/tests/max_concurrent_streams.c +++ b/test/core/end2end/tests/max_concurrent_streams.c @@ -58,7 +58,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -74,7 +74,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; @@ -343,7 +343,7 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { got_server_start = 0; live_call = -1; while (!got_client_start || !got_server_start) { - ev = grpc_completion_queue_next(f.cq, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3), + ev = grpc_completion_queue_next(f.cq, grpc_timeout_seconds_to_deadline(3), NULL); GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); GPR_ASSERT(ev.success); diff --git a/test/core/end2end/tests/max_message_length.c b/test/core/end2end/tests/max_message_length.c index 4c9c218b5ae..b15d30f58c4 100644 --- a/test/core/end2end/tests/max_message_length.c +++ b/test/core/end2end/tests/max_message_length.c @@ -67,7 +67,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -83,7 +83,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/negative_deadline.c b/test/core/end2end/tests/negative_deadline.c index d6271d788c2..0b61efbac97 100644 --- a/test/core/end2end/tests/negative_deadline.c +++ b/test/core/end2end/tests/negative_deadline.c @@ -60,7 +60,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -76,7 +76,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/network_status_change.c b/test/core/end2end/tests/network_status_change.c index fe3afb7249d..9cef02b2b3b 100644 --- a/test/core/end2end/tests/network_status_change.c +++ b/test/core/end2end/tests/network_status_change.c @@ -61,7 +61,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(500); } @@ -77,7 +77,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/no_logging.c b/test/core/end2end/tests/no_logging.c index 72a52353903..56e48a88a87 100644 --- a/test/core/end2end/tests/no_logging.c +++ b/test/core/end2end/tests/no_logging.c @@ -88,7 +88,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -104,7 +104,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/no_op.c b/test/core/end2end/tests/no_op.c index 09294bf0e9e..62fc728c3eb 100644 --- a/test/core/end2end/tests/no_op.c +++ b/test/core/end2end/tests/no_op.c @@ -58,7 +58,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -74,7 +74,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/payload.c b/test/core/end2end/tests/payload.c index e23013d1a79..b04ee5705c6 100644 --- a/test/core/end2end/tests/payload.c +++ b/test/core/end2end/tests/payload.c @@ -58,7 +58,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -74,7 +74,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/ping.c b/test/core/end2end/tests/ping.c index 5e5169dedce..61f4337f2fd 100644 --- a/test/core/end2end/tests/ping.c +++ b/test/core/end2end/tests/ping.c @@ -61,7 +61,7 @@ static void test_ping(grpc_end2end_test_config config) { READY is reached */ while (state != GRPC_CHANNEL_READY) { grpc_channel_watch_connectivity_state( - f.client, state, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3), f.cq, tag(99)); + f.client, state, grpc_timeout_seconds_to_deadline(3), f.cq, tag(99)); CQ_EXPECT_COMPLETION(cqv, tag(99), 1); cq_verify(cqv); state = grpc_channel_check_connectivity_state(f.client, 0); diff --git a/test/core/end2end/tests/ping_pong_streaming.c b/test/core/end2end/tests/ping_pong_streaming.c index 1aa23ea6e02..848f76018d1 100644 --- a/test/core/end2end/tests/ping_pong_streaming.c +++ b/test/core/end2end/tests/ping_pong_streaming.c @@ -58,7 +58,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -74,7 +74,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/registered_call.c b/test/core/end2end/tests/registered_call.c index 9844e3de760..9c8ce89c838 100644 --- a/test/core/end2end/tests/registered_call.c +++ b/test/core/end2end/tests/registered_call.c @@ -60,7 +60,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -76,7 +76,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/request_with_flags.c b/test/core/end2end/tests/request_with_flags.c index 4a296a62d75..329359e08b8 100644 --- a/test/core/end2end/tests/request_with_flags.c +++ b/test/core/end2end/tests/request_with_flags.c @@ -59,7 +59,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -75,7 +75,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/request_with_payload.c b/test/core/end2end/tests/request_with_payload.c index 15c790b1299..f71f92bbb84 100644 --- a/test/core/end2end/tests/request_with_payload.c +++ b/test/core/end2end/tests/request_with_payload.c @@ -58,7 +58,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -74,7 +74,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/resource_quota_server.c b/test/core/end2end/tests/resource_quota_server.c index 1000b63add8..3fbe0aa0d02 100644 --- a/test/core/end2end/tests/resource_quota_server.c +++ b/test/core/end2end/tests/resource_quota_server.c @@ -58,7 +58,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -74,7 +74,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/server_finishes_request.c b/test/core/end2end/tests/server_finishes_request.c index 57c46d36a41..b42d17002e8 100644 --- a/test/core/end2end/tests/server_finishes_request.c +++ b/test/core/end2end/tests/server_finishes_request.c @@ -60,7 +60,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -76,7 +76,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/shutdown_finishes_calls.c b/test/core/end2end/tests/shutdown_finishes_calls.c index b8c8dc9f062..c019682ea66 100644 --- a/test/core/end2end/tests/shutdown_finishes_calls.c +++ b/test/core/end2end/tests/shutdown_finishes_calls.c @@ -58,7 +58,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } diff --git a/test/core/end2end/tests/shutdown_finishes_tags.c b/test/core/end2end/tests/shutdown_finishes_tags.c index 06f7e75630f..5540d2aab9c 100644 --- a/test/core/end2end/tests/shutdown_finishes_tags.c +++ b/test/core/end2end/tests/shutdown_finishes_tags.c @@ -58,7 +58,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } diff --git a/test/core/end2end/tests/simple_cacheable_request.c b/test/core/end2end/tests/simple_cacheable_request.c index 3fbc35d8806..4eef02e9eed 100644 --- a/test/core/end2end/tests/simple_cacheable_request.c +++ b/test/core/end2end/tests/simple_cacheable_request.c @@ -60,7 +60,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -76,7 +76,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/simple_delayed_request.c b/test/core/end2end/tests/simple_delayed_request.c index 50ee7d35b00..ea6b3e9645c 100644 --- a/test/core/end2end/tests/simple_delayed_request.c +++ b/test/core/end2end/tests/simple_delayed_request.c @@ -46,7 +46,7 @@ static void *tag(intptr_t t) { return (void *)t; } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -62,7 +62,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/simple_metadata.c b/test/core/end2end/tests/simple_metadata.c index 7086d527ede..7ab5563cfa9 100644 --- a/test/core/end2end/tests/simple_metadata.c +++ b/test/core/end2end/tests/simple_metadata.c @@ -58,7 +58,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -74,7 +74,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/simple_request.c b/test/core/end2end/tests/simple_request.c index 7580ad1f7fe..af5d74959e3 100644 --- a/test/core/end2end/tests/simple_request.c +++ b/test/core/end2end/tests/simple_request.c @@ -60,7 +60,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -76,7 +76,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/streaming_error_response.c b/test/core/end2end/tests/streaming_error_response.c index d5fefd13aae..42055907c85 100644 --- a/test/core/end2end/tests/streaming_error_response.c +++ b/test/core/end2end/tests/streaming_error_response.c @@ -60,7 +60,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -76,7 +76,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/trailing_metadata.c b/test/core/end2end/tests/trailing_metadata.c index ca5cf2cd5ca..dbbda505bc4 100644 --- a/test/core/end2end/tests/trailing_metadata.c +++ b/test/core/end2end/tests/trailing_metadata.c @@ -58,7 +58,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -74,7 +74,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/write_buffering.c b/test/core/end2end/tests/write_buffering.c index 50c0ed7ab40..abf90ca6e06 100644 --- a/test/core/end2end/tests/write_buffering.c +++ b/test/core/end2end/tests/write_buffering.c @@ -58,7 +58,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -74,7 +74,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/end2end/tests/write_buffering_at_end.c b/test/core/end2end/tests/write_buffering_at_end.c index 5f68ed00a14..8c02b425bae 100644 --- a/test/core/end2end/tests/write_buffering_at_end.c +++ b/test/core/end2end/tests/write_buffering_at_end.c @@ -58,7 +58,7 @@ static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, } static gpr_timespec n_seconds_time(int n) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n); + return grpc_timeout_seconds_to_deadline(n); } static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); } @@ -74,7 +74,7 @@ static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/fling/client.c b/test/core/fling/client.c index c4de949b3a7..85bab6d431b 100644 --- a/test/core/fling/client.c +++ b/test/core/fling/client.c @@ -214,9 +214,9 @@ int main(int argc, char **argv) { sc.init(); - gpr_timespec end_warmup = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(warmup_seconds); + gpr_timespec end_warmup = grpc_timeout_seconds_to_deadline(warmup_seconds); gpr_timespec end_profiling = - GRPC_TIMEOUT_SECONDS_TO_DEADLINE(warmup_seconds + benchmark_seconds); + grpc_timeout_seconds_to_deadline(warmup_seconds + benchmark_seconds); while (gpr_time_cmp(gpr_now(end_warmup.clock_type), end_warmup) < 0) { sc.do_one_step(); diff --git a/test/core/fling/server.c b/test/core/fling/server.c index 11742cedb61..7ea54b1167e 100644 --- a/test/core/fling/server.c +++ b/test/core/fling/server.c @@ -244,7 +244,7 @@ int main(int argc, char **argv) { gpr_log(GPR_INFO, "Shutting down due to SIGINT"); grpc_server_shutdown_and_notify(server, cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_completion_queue_shutdown(cq); shutdown_started = 1; diff --git a/test/core/handshake/client_ssl.c b/test/core/handshake/client_ssl.c index 613251b8355..a22133e629f 100644 --- a/test/core/handshake/client_ssl.c +++ b/test/core/handshake/client_ssl.c @@ -274,8 +274,8 @@ static bool client_ssl_test(char *server_alpn_preferred) { grpc_completion_queue *cq = grpc_completion_queue_create(NULL); while (state != GRPC_CHANNEL_READY && retries-- > 0) { grpc_channel_watch_connectivity_state( - channel, state, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3), cq, NULL); - gpr_timespec cq_deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5); + channel, state, grpc_timeout_seconds_to_deadline(3), cq, NULL); + gpr_timespec cq_deadline = grpc_timeout_seconds_to_deadline(5); grpc_event ev = grpc_completion_queue_next(cq, cq_deadline, NULL); GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); state = diff --git a/test/core/handshake/server_ssl.c b/test/core/handshake/server_ssl.c index f39b0040a6c..0bd5a03cffe 100644 --- a/test/core/handshake/server_ssl.c +++ b/test/core/handshake/server_ssl.c @@ -113,7 +113,7 @@ static void server_thread(void *arg) { // sleeping between polls. int retries = 10; while (!gpr_event_get(&client_handshake_complete) && retries-- > 0) { - const gpr_timespec cq_deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1); + const gpr_timespec cq_deadline = grpc_timeout_seconds_to_deadline(1); grpc_event ev = grpc_completion_queue_next(cq, cq_deadline, NULL); GPR_ASSERT(ev.type == GRPC_QUEUE_TIMEOUT); } @@ -122,7 +122,7 @@ static void server_thread(void *arg) { grpc_server_shutdown_and_notify(server, cq, NULL); grpc_completion_queue_shutdown(cq); - const gpr_timespec cq_deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5); + const gpr_timespec cq_deadline = grpc_timeout_seconds_to_deadline(5); grpc_event ev = grpc_completion_queue_next(cq, cq_deadline, NULL); GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); diff --git a/test/core/http/httpcli_test.c b/test/core/http/httpcli_test.c index 4cdbb5d6da6..6cc00f871d8 100644 --- a/test/core/http/httpcli_test.c +++ b/test/core/http/httpcli_test.c @@ -51,7 +51,7 @@ static gpr_mu *g_mu; static grpc_polling_entity g_pops; static gpr_timespec n_seconds_time(int seconds) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(seconds); + return grpc_timeout_seconds_to_deadline(seconds); } static void on_finish(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { diff --git a/test/core/http/httpscli_test.c b/test/core/http/httpscli_test.c index 72017cfa54e..e1a26d91e9e 100644 --- a/test/core/http/httpscli_test.c +++ b/test/core/http/httpscli_test.c @@ -51,7 +51,7 @@ static gpr_mu *g_mu; static grpc_polling_entity g_pops; static gpr_timespec n_seconds_time(int seconds) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(seconds); + return grpc_timeout_seconds_to_deadline(seconds); } static void on_finish(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { diff --git a/test/core/iomgr/combiner_test.c b/test/core/iomgr/combiner_test.c index 9b6d6ff9b46..4c9275a6732 100644 --- a/test/core/iomgr/combiner_test.c +++ b/test/core/iomgr/combiner_test.c @@ -103,7 +103,7 @@ static void execute_many_loop(void *a) { } // sleep for a little bit, to test a combiner draining and another thread // picking it up - gpr_sleep_until(GRPC_TIMEOUT_MILLIS_TO_DEADLINE(100)); + gpr_sleep_until(grpc_timeout_milliseconds_to_deadline(100)); } grpc_exec_ctx_finish(&exec_ctx); } diff --git a/test/core/iomgr/endpoint_tests.c b/test/core/iomgr/endpoint_tests.c index bbc5f383f63..94067a8ca4d 100644 --- a/test/core/iomgr/endpoint_tests.c +++ b/test/core/iomgr/endpoint_tests.c @@ -187,7 +187,7 @@ static void read_and_write_test(grpc_endpoint_test_config config, size_t num_bytes, size_t write_size, size_t slice_size, bool shutdown) { struct read_and_write_test_state state; - gpr_timespec deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(20); + gpr_timespec deadline = grpc_timeout_seconds_to_deadline(20); grpc_endpoint_test_fixture f = begin_test(config, "read_and_write_test", slice_size); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; diff --git a/test/core/iomgr/resolve_address_posix_test.c b/test/core/iomgr/resolve_address_posix_test.c index e256609571a..a4feff8b009 100644 --- a/test/core/iomgr/resolve_address_posix_test.c +++ b/test/core/iomgr/resolve_address_posix_test.c @@ -47,7 +47,7 @@ #include "test/core/util/test_config.h" static gpr_timespec test_deadline(void) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(100); + return grpc_timeout_seconds_to_deadline(100); } typedef struct args_struct { diff --git a/test/core/iomgr/resolve_address_test.c b/test/core/iomgr/resolve_address_test.c index 84f4ed4c90e..54de9a20e1c 100644 --- a/test/core/iomgr/resolve_address_test.c +++ b/test/core/iomgr/resolve_address_test.c @@ -42,7 +42,7 @@ #include "test/core/util/test_config.h" static gpr_timespec test_deadline(void) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(100); + return grpc_timeout_seconds_to_deadline(100); } typedef struct args_struct { diff --git a/test/core/iomgr/tcp_client_posix_test.c b/test/core/iomgr/tcp_client_posix_test.c index 6bb00bc7872..dcdff8efb13 100644 --- a/test/core/iomgr/tcp_client_posix_test.c +++ b/test/core/iomgr/tcp_client_posix_test.c @@ -57,7 +57,7 @@ static int g_connections_complete = 0; static grpc_endpoint *g_connecting = NULL; static gpr_timespec test_deadline(void) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(10); + return grpc_timeout_seconds_to_deadline(10); } static void finish_connection() { @@ -135,7 +135,7 @@ void test_succeeds(void) { "pollset_work", grpc_pollset_work(&exec_ctx, g_pollset, &worker, gpr_now(GPR_CLOCK_MONOTONIC), - GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)))); + 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 cabb64eb8f1..99ecd581c6d 100644 --- a/test/core/iomgr/tcp_posix_test.c +++ b/test/core/iomgr/tcp_posix_test.c @@ -175,7 +175,7 @@ static void read_test(size_t num_bytes, size_t slice_size) { grpc_endpoint *ep; struct read_socket_state state; size_t written_bytes; - gpr_timespec deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(20); + gpr_timespec deadline = 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, @@ -226,7 +226,7 @@ static void large_read_test(size_t slice_size) { grpc_endpoint *ep; struct read_socket_state state; ssize_t written_bytes; - gpr_timespec deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(20); + gpr_timespec deadline = 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); @@ -330,7 +330,7 @@ void drain_socket_blocking(int fd, size_t num_bytes, size_t read_size) { "pollset_work", grpc_pollset_work(&exec_ctx, g_pollset, &worker, gpr_now(GPR_CLOCK_MONOTONIC), - GRPC_TIMEOUT_MILLIS_TO_DEADLINE(10)))); + grpc_timeout_milliseconds_to_deadline(10)))); gpr_mu_unlock(g_mu); grpc_exec_ctx_finish(&exec_ctx); do { @@ -363,7 +363,7 @@ static void write_test(size_t num_bytes, size_t slice_size) { uint8_t current_data = 0; grpc_slice_buffer outgoing; grpc_closure write_done_closure; - gpr_timespec deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(20); + gpr_timespec deadline = grpc_timeout_seconds_to_deadline(20); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; gpr_log(GPR_INFO, @@ -428,7 +428,7 @@ static void release_fd_test(size_t num_bytes, size_t slice_size) { struct read_socket_state state; size_t written_bytes; int fd; - gpr_timespec deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(20); + gpr_timespec deadline = 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 417bc5111a0..7122cd1e869 100644 --- a/test/core/iomgr/tcp_server_posix_test.c +++ b/test/core/iomgr/tcp_server_posix_test.c @@ -202,7 +202,7 @@ static void test_no_op_with_port_and_start(void) { static void tcp_connect(grpc_exec_ctx *exec_ctx, const struct sockaddr *remote, socklen_t remote_len, on_connect_result *result) { - gpr_timespec deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(10); + gpr_timespec deadline = grpc_timeout_seconds_to_deadline(10); int clifd = socket(remote->sa_family, SOCK_STREAM, 0); int nconnects_before; diff --git a/test/core/iomgr/udp_server_test.c b/test/core/iomgr/udp_server_test.c index e1210401c81..9ec6d7bf207 100644 --- a/test/core/iomgr/udp_server_test.c +++ b/test/core/iomgr/udp_server_test.c @@ -179,7 +179,7 @@ static void test_receive(int number_of_clients) { gpr_mu_lock(g_mu); for (i = 0; i < number_of_clients; i++) { - deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(10); + deadline = grpc_timeout_seconds_to_deadline(10); number_of_reads_before = g_number_of_reads; /* Create a socket, send a packet to the UDP server. */ diff --git a/test/core/memory_usage/server.c b/test/core/memory_usage/server.c index 1cae4f40640..ab059c25b8b 100644 --- a/test/core/memory_usage/server.c +++ b/test/core/memory_usage/server.c @@ -232,7 +232,7 @@ int main(int argc, char **argv) { gpr_log(GPR_INFO, "Shutting down due to SIGINT"); grpc_server_shutdown_and_notify(server, cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_completion_queue_shutdown(cq); shutdown_started = 1; diff --git a/test/core/statistics/census_log_tests.c b/test/core/statistics/census_log_tests.c index 8646a2fdf1d..0f96f014eae 100644 --- a/test/core/statistics/census_log_tests.c +++ b/test/core/statistics/census_log_tests.c @@ -199,7 +199,7 @@ static void writer_thread(void *arg) { This should never happen for circular logs. */ printf(" Writer stalled due to out-of-space: %d out of %d written\n", records_written, args->num_records); - gpr_sleep_until(GRPC_TIMEOUT_MILLIS_TO_DEADLINE(10)); + gpr_sleep_until(grpc_timeout_milliseconds_to_deadline(10)); } } /* Done. Decrement count and signal. */ diff --git a/test/core/support/cpu_test.c b/test/core/support/cpu_test.c index a5c52442ad4..ca0fe0ccb50 100644 --- a/test/core/support/cpu_test.c +++ b/test/core/support/cpu_test.c @@ -81,9 +81,9 @@ static void worker_thread(void *arg) { uint32_t cpu; unsigned r = 12345678; unsigned i, j; - for (i = 0; i < 1000 / GRPC_TEST_SLOWDOWN_FACTOR; i++) { + for (i = 0; i < 1000 / grpc_test_slowdown_factor(); i++) { /* run for a bit - just calculate something random. */ - for (j = 0; j < 1000000 / GRPC_TEST_SLOWDOWN_FACTOR; j++) { + for (j = 0; j < 1000000 / grpc_test_slowdown_factor(); j++) { r = (r * 17) & ((r - i) | (r * i)); } cpu = gpr_cpu_current_cpu(); diff --git a/test/core/surface/alarm_test.c b/test/core/surface/alarm_test.c index 054c3283897..4afe357c277 100644 --- a/test/core/surface/alarm_test.c +++ b/test/core/surface/alarm_test.c @@ -64,9 +64,9 @@ static void test_alarm(void) { grpc_event ev; void *tag = create_test_tag(); grpc_alarm *alarm = - grpc_alarm_create(cc, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1), tag); + grpc_alarm_create(cc, grpc_timeout_seconds_to_deadline(1), tag); - ev = grpc_completion_queue_next(cc, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(2), + ev = grpc_completion_queue_next(cc, grpc_timeout_seconds_to_deadline(2), NULL); GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); GPR_ASSERT(ev.tag == tag); @@ -78,10 +78,10 @@ static void test_alarm(void) { grpc_event ev; void *tag = create_test_tag(); grpc_alarm *alarm = - grpc_alarm_create(cc, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(2), tag); + grpc_alarm_create(cc, grpc_timeout_seconds_to_deadline(2), tag); grpc_alarm_cancel(alarm); - ev = grpc_completion_queue_next(cc, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1), + ev = grpc_completion_queue_next(cc, grpc_timeout_seconds_to_deadline(1), NULL); GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); GPR_ASSERT(ev.tag == tag); diff --git a/test/core/surface/completion_queue_test.c b/test/core/surface/completion_queue_test.c index 1486d2508f6..b8ea90921a8 100644 --- a/test/core/surface/completion_queue_test.c +++ b/test/core/surface/completion_queue_test.c @@ -232,7 +232,7 @@ static void test_too_many_plucks(void) { } /* wait until all other threads are plucking */ - gpr_sleep_until(GRPC_TIMEOUT_MILLIS_TO_DEADLINE(1000)); + gpr_sleep_until(grpc_timeout_milliseconds_to_deadline(1000)); ev = grpc_completion_queue_pluck(cc, create_test_tag(), gpr_inf_future(GPR_CLOCK_REALTIME), NULL); @@ -266,7 +266,7 @@ typedef struct test_thread_options { } test_thread_options; gpr_timespec ten_seconds_time(void) { - return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(10); + return grpc_timeout_seconds_to_deadline(10); } static void free_completion(grpc_exec_ctx *exec_ctx, void *arg, diff --git a/test/core/surface/concurrent_connectivity_test.c b/test/core/surface/concurrent_connectivity_test.c index 7071f93d8db..4f7a25ab934 100644 --- a/test/core/surface/concurrent_connectivity_test.c +++ b/test/core/surface/concurrent_connectivity_test.c @@ -70,11 +70,13 @@ void create_loop_destroy(void *addr) { grpc_channel *chan = grpc_insecure_channel_create((char *)addr, NULL, NULL); for (int j = 0; j < NUM_INNER_LOOPS; ++j) { - gpr_timespec later_time = GRPC_TIMEOUT_MILLIS_TO_DEADLINE(DELAY_MILLIS); + gpr_timespec later_time = + grpc_timeout_milliseconds_to_deadline(DELAY_MILLIS); grpc_connectivity_state state = grpc_channel_check_connectivity_state(chan, 1); grpc_channel_watch_connectivity_state(chan, state, later_time, cq, NULL); - gpr_timespec poll_time = GRPC_TIMEOUT_MILLIS_TO_DEADLINE(POLL_MILLIS); + gpr_timespec poll_time = + grpc_timeout_milliseconds_to_deadline(POLL_MILLIS); GPR_ASSERT(grpc_completion_queue_next(cq, poll_time, NULL).type == GRPC_OP_COMPLETE); } diff --git a/test/core/surface/lame_client_test.c b/test/core/surface/lame_client_test.c index b5b42c16ffa..9deb50bb044 100644 --- a/test/core/surface/lame_client_test.c +++ b/test/core/surface/lame_client_test.c @@ -113,7 +113,7 @@ int main(int argc, char **argv) { grpc_slice host = grpc_slice_from_static_string("anywhere"); call = grpc_channel_create_call(chan, NULL, GRPC_PROPAGATE_DEFAULTS, cq, grpc_slice_from_static_string("/Foo"), &host, - GRPC_TIMEOUT_SECONDS_TO_DEADLINE(100), NULL); + grpc_timeout_seconds_to_deadline(100), NULL); GPR_ASSERT(call); cqv = cq_verifier_create(cq); diff --git a/test/core/surface/sequential_connectivity_test.c b/test/core/surface/sequential_connectivity_test.c index 32927187626..5f66f900372 100644 --- a/test/core/surface/sequential_connectivity_test.c +++ b/test/core/surface/sequential_connectivity_test.c @@ -91,7 +91,7 @@ static void run_test(const test_fixture *fixture) { for (size_t i = 0; i < NUM_CONNECTIONS; i++) { channels[i] = fixture->create_channel(addr); - gpr_timespec connect_deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(30); + gpr_timespec connect_deadline = grpc_timeout_seconds_to_deadline(30); grpc_connectivity_state state; while ((state = grpc_channel_check_connectivity_state(channels[i], 1)) != GRPC_CHANNEL_READY) { diff --git a/test/core/util/port_server_client.c b/test/core/util/port_server_client.c index 118708d419c..6d722ffc882 100644 --- a/test/core/util/port_server_client.c +++ b/test/core/util/port_server_client.c @@ -103,7 +103,7 @@ void grpc_free_port_using_server(char *server, int port) { grpc_resource_quota *resource_quota = grpc_resource_quota_create("port_server_client/free"); grpc_httpcli_get(&exec_ctx, &context, &pr.pops, resource_quota, &req, - GRPC_TIMEOUT_SECONDS_TO_DEADLINE(10), + grpc_timeout_seconds_to_deadline(10), grpc_closure_create(freed_port_from_server, &pr, grpc_schedule_on_exec_ctx), &rsp); @@ -115,7 +115,7 @@ void grpc_free_port_using_server(char *server, int port) { "pollset_work", grpc_pollset_work(&exec_ctx, grpc_polling_entity_pollset(&pr.pops), &worker, gpr_now(GPR_CLOCK_MONOTONIC), - GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1)))) { + grpc_timeout_seconds_to_deadline(1)))) { pr.done = 1; } } @@ -176,7 +176,7 @@ static void got_port_from_server(grpc_exec_ctx *exec_ctx, void *arg, grpc_resource_quota *resource_quota = grpc_resource_quota_create("port_server_client/pick_retry"); grpc_httpcli_get(exec_ctx, pr->ctx, &pr->pops, resource_quota, &req, - GRPC_TIMEOUT_SECONDS_TO_DEADLINE(10), + grpc_timeout_seconds_to_deadline(10), grpc_closure_create(got_port_from_server, pr, grpc_schedule_on_exec_ctx), &pr->response); @@ -226,7 +226,7 @@ int grpc_pick_port_using_server(char *server) { grpc_resource_quota_create("port_server_client/pick"); grpc_httpcli_get( &exec_ctx, &context, &pr.pops, resource_quota, &req, - GRPC_TIMEOUT_SECONDS_TO_DEADLINE(10), + grpc_timeout_seconds_to_deadline(10), grpc_closure_create(got_port_from_server, &pr, grpc_schedule_on_exec_ctx), &pr.response); grpc_resource_quota_unref_internal(&exec_ctx, resource_quota); @@ -238,7 +238,7 @@ int grpc_pick_port_using_server(char *server) { "pollset_work", grpc_pollset_work(&exec_ctx, grpc_polling_entity_pollset(&pr.pops), &worker, gpr_now(GPR_CLOCK_MONOTONIC), - GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1)))) { + grpc_timeout_seconds_to_deadline(1)))) { pr.port = 0; } } diff --git a/test/core/util/test_config.c b/test/core/util/test_config.c index d86ed94637c..94aab272531 100644 --- a/test/core/util/test_config.c +++ b/test/core/util/test_config.c @@ -45,8 +45,8 @@ #include "src/core/lib/support/env.h" #include "src/core/lib/support/string.h" -double g_fixture_slowdown_factor = 1.0; -double g_poller_slowdown_factor = 1.0; +int64_t g_fixture_slowdown_factor = 1; +int64_t g_poller_slowdown_factor = 1; #if GPR_GETPID_IN_UNISTD_H #include @@ -278,19 +278,109 @@ static void install_crash_handler() { static void install_crash_handler() {} #endif +bool BuiltUnderValgrind() { +#ifdef RUNNING_ON_VALGRIND + return true; +#else + return false; +#endif +} + +bool BuiltUnderTsan() { +#if defined(__has_feature) +#if __has_feature(thread_sanitizer) + return true; +#else + return false; +#endif +#else +#ifdef THREAD_SANITIZER + return true; +#else + return false; +#endif +#endif +} + +bool BuiltUnderAsan() { +#if defined(__has_feature) +#if __has_feature(address_sanitizer) + return true; +#else + return false; +#endif +#else +#ifdef ADDRESS_SANITIZER + return true; +#else + return false; +#endif +#endif +} + +bool BuiltUnderMsan() { +#if defined(__has_feature) +#if __has_feature(memory_sanitizer) + return true; +#else + return false; +#endif +#else +#ifdef MEMORY_SANITIZER + return true; +#else + return false; +#endif +#endif +} + +int64_t grpc_test_sanitizer_slowdown_factor() { + int64_t sanitizer_multiplier = 1; + if (BuiltUnderValgrind()) { + sanitizer_multiplier = 20; + } else if (BuiltUnderTsan()) { + sanitizer_multiplier = 5; + } else if (BuiltUnderAsan()) { + sanitizer_multiplier = 3; + } else if (BuiltUnderMsan()) { + sanitizer_multiplier = 4; + } + return sanitizer_multiplier; +} + +int64_t grpc_test_slowdown_factor() { + return grpc_test_sanitizer_slowdown_factor() * g_fixture_slowdown_factor * + g_poller_slowdown_factor; +} + +gpr_timespec grpc_timeout_seconds_to_deadline(int64_t time_s) { + return gpr_time_add( + gpr_now(GPR_CLOCK_MONOTONIC), + gpr_time_from_millis(grpc_test_slowdown_factor() * (int64_t)1e3 * time_s, + GPR_TIMESPAN)); +} + +gpr_timespec grpc_timeout_milliseconds_to_deadline(int64_t time_ms) { + return gpr_time_add( + gpr_now(GPR_CLOCK_MONOTONIC), + gpr_time_from_micros(grpc_test_slowdown_factor() * (int64_t)1e3 * time_ms, + GPR_TIMESPAN)); +} + void grpc_test_init(int argc, char **argv) { install_crash_handler(); { /* poll-cv poll strategy runs much more slowly than anything else */ char *s = gpr_getenv("GRPC_POLL_STRATEGY"); if (s != NULL && 0 == strcmp(s, "poll-cv")) { - g_poller_slowdown_factor = 5.0; + g_poller_slowdown_factor = 5; } gpr_free(s); } - gpr_log(GPR_DEBUG, "test slowdown: machine=%f build=%f poll=%f total=%f", - (double)GRPC_TEST_SLOWDOWN_MACHINE_FACTOR, - (double)GRPC_TEST_SLOWDOWN_BUILD_FACTOR, g_poller_slowdown_factor, - (double)GRPC_TEST_SLOWDOWN_FACTOR); + gpr_log(GPR_DEBUG, + "test slowdown factor: sanitizer=%" PRId64 ", fixture=%" PRId64 + ", poller=%" PRId64 ", total=%" PRId64, + grpc_test_sanitizer_slowdown_factor(), g_fixture_slowdown_factor, + g_poller_slowdown_factor, grpc_test_slowdown_factor()); /* seed rng with pid, so we don't end up with the same random numbers as a concurrently running test binary */ srand(seed()); diff --git a/test/core/util/test_config.h b/test/core/util/test_config.h index c13fe86a649..491f011fc8b 100644 --- a/test/core/util/test_config.h +++ b/test/core/util/test_config.h @@ -40,32 +40,17 @@ extern "C" { #endif /* __cplusplus */ -#ifndef GRPC_TEST_SLOWDOWN_BUILD_FACTOR -#define GRPC_TEST_SLOWDOWN_BUILD_FACTOR 1.0 -#endif - -#ifndef GRPC_TEST_SLOWDOWN_MACHINE_FACTOR -#define GRPC_TEST_SLOWDOWN_MACHINE_FACTOR 1.0 -#endif - -extern double g_fixture_slowdown_factor; -extern double g_poller_slowdown_factor; +extern int64_t g_fixture_slowdown_factor; +extern int64_t g_poller_slowdown_factor; -#define GRPC_TEST_SLOWDOWN_FACTOR \ - (GRPC_TEST_SLOWDOWN_BUILD_FACTOR * GRPC_TEST_SLOWDOWN_MACHINE_FACTOR * \ - g_fixture_slowdown_factor * g_poller_slowdown_factor) +/* Returns an appropriate scaling factor for timeouts. */ +int64_t grpc_test_slowdown_factor(); -#define GRPC_TIMEOUT_SECONDS_TO_DEADLINE(x) \ - gpr_time_add( \ - gpr_now(GPR_CLOCK_MONOTONIC), \ - gpr_time_from_millis((int64_t)(GRPC_TEST_SLOWDOWN_FACTOR * 1e3 * (x)), \ - GPR_TIMESPAN)) +/* Converts a given timeout (in seconds) to a deadline. */ +gpr_timespec grpc_timeout_seconds_to_deadline(int64_t time_s); -#define GRPC_TIMEOUT_MILLIS_TO_DEADLINE(x) \ - gpr_time_add( \ - gpr_now(GPR_CLOCK_MONOTONIC), \ - gpr_time_from_micros((int64_t)(GRPC_TEST_SLOWDOWN_FACTOR * 1e3 * (x)), \ - GPR_TIMESPAN)) +/* Converts a given timeout (in milliseconds) to a deadline. */ +gpr_timespec grpc_timeout_milliseconds_to_deadline(int64_t time_ms); #ifndef GRPC_TEST_CUSTOM_PICK_PORT #define GRPC_TEST_PICK_PORT diff --git a/test/cpp/common/alarm_cpp_test.cc b/test/cpp/common/alarm_cpp_test.cc index a05ac30b1c7..41085174a47 100644 --- a/test/cpp/common/alarm_cpp_test.cc +++ b/test/cpp/common/alarm_cpp_test.cc @@ -43,12 +43,12 @@ namespace { TEST(AlarmTest, RegularExpiry) { CompletionQueue cq; void* junk = reinterpret_cast(1618033); - Alarm alarm(&cq, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1), junk); + Alarm alarm(&cq, grpc_timeout_seconds_to_deadline(1), junk); void* output_tag; bool ok; const CompletionQueue::NextStatus status = cq.AsyncNext( - (void**)&output_tag, &ok, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(2)); + (void**)&output_tag, &ok, grpc_timeout_seconds_to_deadline(2)); EXPECT_EQ(status, CompletionQueue::GOT_EVENT); EXPECT_TRUE(ok); @@ -65,7 +65,7 @@ TEST(AlarmTest, RegularExpiryChrono) { void* output_tag; bool ok; const CompletionQueue::NextStatus status = cq.AsyncNext( - (void**)&output_tag, &ok, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(2)); + (void**)&output_tag, &ok, grpc_timeout_seconds_to_deadline(2)); EXPECT_EQ(status, CompletionQueue::GOT_EVENT); EXPECT_TRUE(ok); @@ -75,12 +75,12 @@ TEST(AlarmTest, RegularExpiryChrono) { TEST(AlarmTest, ZeroExpiry) { CompletionQueue cq; void* junk = reinterpret_cast(1618033); - Alarm alarm(&cq, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(0), junk); + Alarm alarm(&cq, grpc_timeout_seconds_to_deadline(0), junk); void* output_tag; bool ok; const CompletionQueue::NextStatus status = cq.AsyncNext( - (void**)&output_tag, &ok, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(0)); + (void**)&output_tag, &ok, grpc_timeout_seconds_to_deadline(0)); EXPECT_EQ(status, CompletionQueue::GOT_EVENT); EXPECT_TRUE(ok); @@ -90,12 +90,12 @@ TEST(AlarmTest, ZeroExpiry) { TEST(AlarmTest, NegativeExpiry) { CompletionQueue cq; void* junk = reinterpret_cast(1618033); - Alarm alarm(&cq, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(-1), junk); + Alarm alarm(&cq, grpc_timeout_seconds_to_deadline(-1), junk); void* output_tag; bool ok; const CompletionQueue::NextStatus status = cq.AsyncNext( - (void**)&output_tag, &ok, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(0)); + (void**)&output_tag, &ok, grpc_timeout_seconds_to_deadline(0)); EXPECT_EQ(status, CompletionQueue::GOT_EVENT); EXPECT_TRUE(ok); @@ -105,13 +105,13 @@ TEST(AlarmTest, NegativeExpiry) { TEST(AlarmTest, Cancellation) { CompletionQueue cq; void* junk = reinterpret_cast(1618033); - Alarm alarm(&cq, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(2), junk); + Alarm alarm(&cq, grpc_timeout_seconds_to_deadline(2), junk); alarm.Cancel(); void* output_tag; bool ok; const CompletionQueue::NextStatus status = cq.AsyncNext( - (void**)&output_tag, &ok, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1)); + (void**)&output_tag, &ok, grpc_timeout_seconds_to_deadline(1)); EXPECT_EQ(status, CompletionQueue::GOT_EVENT); EXPECT_FALSE(ok); diff --git a/test/cpp/grpclb/grpclb_test.cc b/test/cpp/grpclb/grpclb_test.cc index a10cda7ddb9..4b8a434c789 100644 --- a/test/cpp/grpclb/grpclb_test.cc +++ b/test/cpp/grpclb/grpclb_test.cc @@ -170,7 +170,7 @@ static grpc_slice build_response_payload_slice( static void drain_cq(grpc_completion_queue *cq) { grpc_event ev; do { - ev = grpc_completion_queue_next(cq, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), + ev = grpc_completion_queue_next(cq, grpc_timeout_seconds_to_deadline(5), NULL); } while (ev.type != GRPC_QUEUE_SHUTDOWN); } @@ -336,7 +336,7 @@ static void start_backend_server(server_fixture *sf) { GPR_ASSERT(GRPC_CALL_OK == error); gpr_log(GPR_INFO, "Server[%s] up", sf->servers_hostport); ev = grpc_completion_queue_next(sf->cq, - GRPC_TIMEOUT_SECONDS_TO_DEADLINE(60), NULL); + grpc_timeout_seconds_to_deadline(60), NULL); if (!ev.success) { gpr_log(GPR_INFO, "Server[%s] being torn down", sf->servers_hostport); cq_verifier_destroy(cqv); @@ -380,7 +380,7 @@ static void start_backend_server(server_fixture *sf) { error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL); GPR_ASSERT(GRPC_CALL_OK == error); ev = grpc_completion_queue_next( - sf->cq, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3), NULL); + sf->cq, grpc_timeout_seconds_to_deadline(3), NULL); if (ev.type == GRPC_OP_COMPLETE && ev.success) { GPR_ASSERT(ev.tag = tag(102)); if (request_payload_recv == NULL) { @@ -410,7 +410,7 @@ static void start_backend_server(server_fixture *sf) { grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL); GPR_ASSERT(GRPC_CALL_OK == error); ev = grpc_completion_queue_next( - sf->cq, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3), NULL); + sf->cq, grpc_timeout_seconds_to_deadline(3), NULL); if (ev.type == GRPC_OP_COMPLETE && ev.success) { GPR_ASSERT(ev.tag = tag(103)); } else { @@ -477,7 +477,7 @@ static void perform_request(client_fixture *cf) { grpc_slice host = grpc_slice_from_static_string("foo.test.google.fr:1234"); c = grpc_channel_create_call(cf->client, NULL, GRPC_PROPAGATE_DEFAULTS, cf->cq, grpc_slice_from_static_string("/foo"), - &host, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), + &host, grpc_timeout_seconds_to_deadline(5), NULL); gpr_log(GPR_INFO, "Call 0x%" PRIxPTR " created", (intptr_t)c); GPR_ASSERT(c); @@ -605,7 +605,7 @@ static void teardown_server(server_fixture *sf) { gpr_log(GPR_INFO, "Server[%s] shutting down", sf->servers_hostport); grpc_server_shutdown_and_notify(sf->server, sf->cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck( - sf->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL) + sf->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(sf->server); gpr_thd_join(sf->tid); diff --git a/test/cpp/qps/qps_openloop_test.cc b/test/cpp/qps/qps_openloop_test.cc index 8dc50ac6d88..70e2709ac02 100644 --- a/test/cpp/qps/qps_openloop_test.cc +++ b/test/cpp/qps/qps_openloop_test.cc @@ -56,7 +56,7 @@ static void RunQPS() { client_config.set_async_client_threads(8); client_config.set_rpc_type(STREAMING); client_config.mutable_load_params()->mutable_poisson()->set_offered_load( - 1000.0 / GRPC_TEST_SLOWDOWN_FACTOR); + 1000.0 / grpc_test_slowdown_factor()); ServerConfig server_config; server_config.set_server_type(ASYNC_SERVER); diff --git a/tools/run_tests/generated/configs.json b/tools/run_tests/generated/configs.json index f2c110766b2..091f5d98239 100644 --- a/tools/run_tests/generated/configs.json +++ b/tools/run_tests/generated/configs.json @@ -7,7 +7,6 @@ }, { "config": "helgrind", - "timeout_multiplier": 20, "tool_prefix": [ "valgrind", "--tool=helgrind" @@ -17,16 +16,14 @@ "config": "asan-noleaks", "environ": { "ASAN_OPTIONS": "detect_leaks=0:color=always" - }, - "timeout_multiplier": 3 + } }, { "config": "asan-trace-cmp", "environ": { "ASAN_OPTIONS": "detect_leaks=1:color=always", "LSAN_OPTIONS": "suppressions=tools/lsan_suppressions.txt:report_objects=1" - }, - "timeout_multiplier": 3 + } }, { "config": "dbg" @@ -39,7 +36,6 @@ }, { "config": "memcheck", - "timeout_multiplier": 10, "tool_prefix": [ "valgrind", "--tool=memcheck", @@ -51,26 +47,22 @@ "environ": { "ASAN_OPTIONS": "detect_leaks=1:color=always", "LSAN_OPTIONS": "suppressions=tools/lsan_suppressions.txt:report_objects=1" - }, - "timeout_multiplier": 3 + } }, { "config": "tsan", "environ": { "TSAN_OPTIONS": "suppressions=tools/tsan_suppressions.txt:halt_on_error=1:second_deadlock_stack=1" - }, - "timeout_multiplier": 5 + } }, { "config": "ubsan", "environ": { "UBSAN_OPTIONS": "halt_on_error=1:print_stacktrace=1" - }, - "timeout_multiplier": 1.5 + } }, { - "config": "msan", - "timeout_multiplier": 4 + "config": "msan" }, { "config": "mutrace" diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 5aae3432e16..c1822886795 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -234,6 +234,17 @@ class CLanguage(object): timeout_scaling = 1 if polling_strategy == 'poll-cv': timeout_scaling *= 5 + + # Scale overall test timeout if running under various sanitizers. + config = self.args.config + if ('asan' in config + or config == 'msan' + or config == 'tsan' + or config == 'ubsan' + or config == 'helgrind' + or config == 'memcheck'): + timeout_scaling *= 20 + if self.config.build_config in target['exclude_configs']: continue if self.args.iomgr_platform in target.get('exclude_iomgrs', []):